From f084ca70edfad19b437cf298df68236de7f510ee Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Fri, 16 Jul 2021 14:30:24 -0700 Subject: [PATCH] Remove swiftExperimental from codegen --- .../ApolloCodegenOptions.swift | 7 --- .../ApolloCodegenTests.swift | 53 ------------------- 2 files changed, 60 deletions(-) diff --git a/Sources/ApolloCodegenLib/ApolloCodegenOptions.swift b/Sources/ApolloCodegenLib/ApolloCodegenOptions.swift index 638564c4af..983ae921ea 100644 --- a/Sources/ApolloCodegenLib/ApolloCodegenOptions.swift +++ b/Sources/ApolloCodegenLib/ApolloCodegenOptions.swift @@ -18,9 +18,6 @@ public struct ApolloCodegenOptions { /// The default, tried and true code generation engine case typescript - /// The VERY WORK IN PROGRESS Swift code generation engine. Use at your own risk! - case swiftExperimental - /// The current default for the code generation engine. public static var `default`: CodeGenerationEngine { .typescript @@ -30,8 +27,6 @@ public struct ApolloCodegenOptions { switch self { case .typescript: return "swift" - case .swiftExperimental: - return "json-modern" } } } @@ -145,8 +140,6 @@ public struct ApolloCodegenOptions { switch codegenEngine { case .typescript: outputFileURL = folder.appendingPathComponent("API.swift") - case .swiftExperimental: - outputFileURL = folder.appendingPathComponent("API.json") } let operationIDsURL = folder.appendingPathComponent("operationIDs.json") diff --git a/Tests/ApolloCodegenTests/ApolloCodegenTests.swift b/Tests/ApolloCodegenTests/ApolloCodegenTests.swift index 22af531a50..7b985215ae 100644 --- a/Tests/ApolloCodegenTests/ApolloCodegenTests.swift +++ b/Tests/ApolloCodegenTests/ApolloCodegenTests.swift @@ -58,59 +58,6 @@ class ApolloCodegenTests: XCTestCase { ]) } - func testCreatingOptionsWithAllParameters() throws { - let sourceRoot = CodegenTestHelper.sourceRootURL() - let output = sourceRoot.appendingPathComponent("API") - let schema = sourceRoot.appendingPathComponent("schema.json") - let only = sourceRoot.appendingPathComponent("only.graphql") - let operationIDsURL = sourceRoot.appendingPathComponent("operationIDs.json") - let namespace = "ANameSpace" - let prefix = "MyPrefix" - - let options = ApolloCodegenOptions(codegenEngine: .swiftExperimental, - includes: "*.graphql", - mergeInFieldsFromFragmentSpreads: false, - modifier: .internal, - namespace: namespace, - omitDeprecatedEnumCases: true, - only: only, - operationIDsURL: operationIDsURL, - outputFormat: .multipleFiles(inFolderAtURL: output), - customScalarFormat: .passthroughWithPrefix(prefix), - urlToSchemaFile: schema) - XCTAssertEqual(options.includes, "*.graphql") - XCTAssertFalse(options.mergeInFieldsFromFragmentSpreads) - XCTAssertEqual(options.namespace, namespace) - XCTAssertEqual(options.only, only) - XCTAssertEqual(options.operationIDsURL, operationIDsURL) - switch options.outputFormat { - case .singleFile: - XCTFail("This should be multiple files!") - case .multipleFiles(let folderURL): - XCTAssertEqual(folderURL, output) - } - XCTAssertEqual(options.customScalarFormat, .passthroughWithPrefix(prefix)) - XCTAssertEqual(options.urlToSchemaFile, schema) - XCTAssertTrue(options.omitDeprecatedEnumCases) - XCTAssertEqual(options.modifier, .internal) - - - XCTAssertEqual(options.arguments, [ - "codegen:generate", - "--target=json-modern", - "--addTypename", - "--includes='*.graphql'", - "--localSchemaFile='\(schema.path)'", - "--namespace=\(namespace)", - "--only='\(only.path)'", - "--operationIdsPath='\(operationIDsURL.path)'", - "--omitDeprecatedEnumCases", - "--passthroughCustomScalars", - "--customScalarsPrefix='\(prefix)'", - "'\(output.path)'", - ]) - } - func testTryingToUseAFileURLToOutputMultipleFilesFails() { let scriptFolderURL = CodegenTestHelper.cliFolderURL() let starWarsFolderURL = CodegenTestHelper.starWarsFolderURL()