Skip to content

Commit

Permalink
fix: Update Codegen generated SPM swift-tools-version check (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvincestari authored and gh-action-runner committed Sep 18, 2024
1 parent b969710 commit d2185aa
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 77 deletions.
2 changes: 1 addition & 1 deletion Sources/AnimalKingdomAPI/AnimalKingdomAPI/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.9

import PackageDescription

Expand Down
2 changes: 1 addition & 1 deletion Sources/GitHubAPI/GitHubAPI/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.9

import PackageDescription

Expand Down
2 changes: 1 addition & 1 deletion Sources/StarWarsAPI/StarWarsAPI/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.9

import PackageDescription

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ
public var name: String { __data["name"] }

public var ifIncludeFriendsDetails: IfIncludeFriendsDetails? { _asInlineFragment() }
public var asDroid: AsDroid? { _asInlineFragment() }

public init(
__typename: String,
Expand Down Expand Up @@ -145,7 +144,7 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ
))
}

/// Hero.Friend.AsDroid
/// Hero.Friend.IfIncludeFriendsDetails.AsDroid
///
/// Parent Type: `Droid`
public struct AsDroid: StarWarsAPI.InlineFragment {
Expand Down Expand Up @@ -175,49 +174,13 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ
],
fulfilledFragments: [
ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.self),
ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.AsDroid.self)
ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.IfIncludeFriendsDetails.self),
ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.IfIncludeFriendsDetails.AsDroid.self)
]
))
}
}
}

/// Hero.Friend.AsDroid
///
/// Parent Type: `Droid`
public struct AsDroid: StarWarsAPI.InlineFragment, ApolloAPI.CompositeInlineFragment {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }

public typealias RootEntityType = HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend
public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid }
public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [
HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.self,
HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.AsDroid.self
] }

/// The name of the character
public var name: String { __data["name"] }
/// This droid's primary function
public var primaryFunction: String? { __data["primaryFunction"] }

public init(
name: String,
primaryFunction: String? = nil
) {
self.init(_dataDict: DataDict(
data: [
"__typename": StarWarsAPI.Objects.Droid.typename,
"name": name,
"primaryFunction": primaryFunction,
],
fulfilledFragments: [
ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.self),
ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.AsDroid.self)
]
))
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SubscriptionAPI/SubscriptionAPI/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.9

import PackageDescription

Expand Down
2 changes: 1 addition & 1 deletion Sources/UploadAPI/UploadAPI/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.9

import PackageDescription

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,6 @@ class SwiftPackageManagerModuleTemplateTests: XCTestCase {
return rendered
}

// MARK: Boilerplate Tests

func test__boilerplate__generatesCorrectSwiftToolsVersion() {
// given
buildSubject()

let expected = """
// swift-tools-version:5.7
"""

// when
let actual = renderSubject()

// then
expect(actual).to(equalLineByLine(expected, ignoringExtraLines: true))
}

func test__boilerplate__generatesRequiredImports() {
// given
buildSubject()

let expected = """
import PackageDescription
"""

// when
let actual = renderSubject()

// then
expect(actual).to(equalLineByLine(expected, atLine: 3, ignoringExtraLines: true))
}

// MARK: PackageDescription tests

func test__packageDescription__givenLowercaseSchemaName_generatesPackageDefinitionWithCapitalizedName() {
Expand Down

0 comments on commit d2185aa

Please sign in to comment.