Skip to content

Commit

Permalink
feature: Adding codegen config support for spm module type versions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
BobaFetters authored and gh-action-runner committed Nov 27, 2024
1 parent ce26b2d commit c528c4d
Show file tree
Hide file tree
Showing 39 changed files with 1,795 additions and 225 deletions.
1,117 changes: 1,117 additions & 0 deletions Tests/ApolloCodegenTests/ApolloCodegenConfigurationCodableTests.swift

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions Tests/ApolloCodegenTests/ApolloCodegenTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ class ApolloCodegenTests: XCTestCase {
operationSearchPaths: [operationsPath]
),
output: .mock(
moduleType: .swiftPackageManager,
moduleType: .swiftPackage(),
operations: .inSchemaModule,
path: directoryURL.path
)
Expand Down Expand Up @@ -756,7 +756,7 @@ class ApolloCodegenTests: XCTestCase {
operationSearchPaths: [operationsPath]
),
output: .mock(
moduleType: .swiftPackageManager,
moduleType: .swiftPackage(),
operations: .absolute(path: operationsOutputURL.path),
path: directoryURL.path
)
Expand Down Expand Up @@ -862,7 +862,7 @@ class ApolloCodegenTests: XCTestCase {
input: .init(schemaPath: schemaPath, operationSearchPaths: [operationsPath]),
output: .init(
schemaTypes: .init(path: directoryURL.path,
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .inSchemaModule,
testMocks: .absolute(path: directoryURL.appendingPathComponent("TestMocks").path)
)
Expand Down Expand Up @@ -938,7 +938,7 @@ class ApolloCodegenTests: XCTestCase {
operationSearchPaths: [operationsPath]
),
output: .mock(
moduleType: .swiftPackageManager,
moduleType: .swiftPackage(),
operations: .inSchemaModule,
path: "./RelativePath"
)
Expand Down Expand Up @@ -1051,7 +1051,7 @@ class ApolloCodegenTests: XCTestCase {
operationSearchPaths: [operationsPath]
),
output: .mock(
moduleType: .swiftPackageManager,
moduleType: .swiftPackage(),
operations: .absolute(path: "./RelativeOperations"),
path: "./RelativePath"
)
Expand Down Expand Up @@ -1183,7 +1183,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .inSchemaModule
),
options: .init(pruneGeneratedFiles: false)
Expand Down Expand Up @@ -1241,7 +1241,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .inSchemaModule
)
)
Expand Down Expand Up @@ -1295,7 +1295,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .absolute(path: "OperationPath")
)
)
Expand Down Expand Up @@ -1364,7 +1364,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .relative(subpath: nil)
)
)
Expand Down Expand Up @@ -1437,7 +1437,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .relative(subpath: nil)
)
)
Expand Down Expand Up @@ -1489,7 +1489,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: schemaDirectory,
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .relative(subpath: relativeSubPath)
),
options: .init(
Expand Down Expand Up @@ -1586,7 +1586,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .relative(subpath: "subpath")
)
)
Expand Down Expand Up @@ -1694,7 +1694,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .relative(subpath: "subpath")
)
)
Expand Down Expand Up @@ -1796,7 +1796,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .relative(subpath: "subpath")
)
)
Expand Down Expand Up @@ -1860,7 +1860,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .inSchemaModule,
testMocks: .absolute(path: absolutePath)
)
Expand Down Expand Up @@ -1917,7 +1917,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
testMocks: .swiftPackage()
)
)
Expand Down Expand Up @@ -1975,7 +1975,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
testMocks: .swiftPackage(targetName: testMockTargetName)
)
)
Expand Down Expand Up @@ -2285,7 +2285,7 @@ class ApolloCodegenTests: XCTestCase {
func test__validation__givenSchemaTypesModule_swiftPackageManager_withCocoapodsCompatibleImportStatements_true_shouldThrow() throws {
// given
let config = ApolloCodegenConfiguration.mock(
.swiftPackageManager,
.swiftPackage(),
options: .init(cocoapodsCompatibleImportStatements: true)
)

Expand All @@ -2301,7 +2301,7 @@ class ApolloCodegenTests: XCTestCase {
func test__validation__givenSchemaTypesModule_swiftPackageManager_withCocoapodsCompatibleImportStatements_false_shouldNotThrow() throws {
// given
let config = ApolloCodegenConfiguration.mock(
.swiftPackageManager,
.swiftPackage(),
options: .init(cocoapodsCompatibleImportStatements: false)
)

Expand Down Expand Up @@ -2387,7 +2387,7 @@ class ApolloCodegenTests: XCTestCase {
),
output: .init(
schemaTypes: .init(path: "SchemaModule",
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .inSchemaModule
)
)
Expand Down Expand Up @@ -2538,7 +2538,7 @@ class ApolloCodegenTests: XCTestCase {
input: .init(schemaPath: schemaPath, operationSearchPaths: [operationsPath]),
output: .init(
schemaTypes: .init(path: directoryURL.path,
moduleType: .swiftPackageManager),
moduleType: .swiftPackage()),
operations: .inSchemaModule
),
options: .init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class FileGeneratorTests: XCTestCase {

private func buildConfig() {
let mockedConfig = ApolloCodegenConfiguration.mock(output: .mock(
moduleType: .swiftPackageManager,
moduleType: .swiftPackage(),
operations: .inSchemaModule
))

Expand Down
Loading

0 comments on commit c528c4d

Please sign in to comment.