diff --git a/.gitignore b/.gitignore index a41474b5a2..17ffb7454a 100644 --- a/.gitignore +++ b/.gitignore @@ -55,4 +55,4 @@ node_modules/ package-lock.json scripts/apollo scripts/apollo.tar.gz -Codegen/ApolloCLI +SwiftScripts/ApolloCLI diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index 6ed68bb3b3..a7419e101c 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -1619,7 +1619,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd \"${SRCROOT}/Codegen\"\nswift run Codegen -t \"GitHub\"\n"; + shellScript = "cd \"${SRCROOT}/SwiftScripts\"\nswift run Codegen -t \"GitHub\"\n"; }; 9FCE2D061E6C251100E34457 /* Generate Apollo Client API */ = { isa = PBXShellScriptBuildPhase; @@ -1633,7 +1633,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd \"${SRCROOT}/Codegen\"\nswift run Codegen -t \"StarWars\"\n"; + shellScript = "cd \"${SRCROOT}/SwiftScripts\"\nswift run Codegen -t \"StarWars\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Codegen/ApolloCLI/.keep b/SwiftScripts/ApolloCLI/.keep similarity index 100% rename from Codegen/ApolloCLI/.keep rename to SwiftScripts/ApolloCLI/.keep diff --git a/Codegen/Package.resolved b/SwiftScripts/Package.resolved similarity index 100% rename from Codegen/Package.resolved rename to SwiftScripts/Package.resolved diff --git a/Codegen/Package.swift b/SwiftScripts/Package.swift similarity index 85% rename from Codegen/Package.swift rename to SwiftScripts/Package.swift index 699464da6a..7693b1f8e3 100644 --- a/Codegen/Package.swift +++ b/SwiftScripts/Package.swift @@ -7,7 +7,7 @@ let package = Package( name: "Codegen", dependencies: [ .package(path: ".."), - .package(url: "https://github.com/apple/swift-tools-support-core", from: "0.0.1") + .package(url: "https://github.com/apple/swift-tools-support-core", from: "0.0.1"), ], targets: [ .target( @@ -15,6 +15,8 @@ let package = Package( dependencies: ["ApolloCodegenLib", "SwiftToolsSupport-auto"]), .target(name: "SchemaDownload", dependencies: ["ApolloCodegenLib"]), + .target(name: "DocumentationGenerator", + dependencies: []), .testTarget( name: "CodegenTests", dependencies: ["Codegen"]), diff --git a/Codegen/README.md b/SwiftScripts/README.md similarity index 100% rename from Codegen/README.md rename to SwiftScripts/README.md diff --git a/Codegen/Sources/Codegen/ArgumentSetup.swift b/SwiftScripts/Sources/Codegen/ArgumentSetup.swift similarity index 100% rename from Codegen/Sources/Codegen/ArgumentSetup.swift rename to SwiftScripts/Sources/Codegen/ArgumentSetup.swift diff --git a/Codegen/Sources/Codegen/main.swift b/SwiftScripts/Sources/Codegen/main.swift similarity index 93% rename from Codegen/Sources/Codegen/main.swift rename to SwiftScripts/Sources/Codegen/main.swift index a2f1a4a9c9..0fa3871cc0 100644 --- a/Codegen/Sources/Codegen/main.swift +++ b/SwiftScripts/Sources/Codegen/main.swift @@ -8,7 +8,7 @@ let parentFolderOfScriptFile = FileFinder.findParentFolder() // Use that to calculate the source root let sourceRootURL = parentFolderOfScriptFile .deletingLastPathComponent() // Sources - .deletingLastPathComponent() // Codegen + .deletingLastPathComponent() // SwiftScripts .deletingLastPathComponent() // apollo-ios // In a typical app, you'll only need to do this for one target, so you'd @@ -25,7 +25,7 @@ try FileManager.default.apollo_createFolderIfNeeded(at: targetURL) // Calculate where you want to download the CLI folder. let cliFolderURL = sourceRootURL - .appendingPathComponent("Codegen") + .appendingPathComponent("SwiftScripts") .appendingPathComponent("ApolloCLI") do { diff --git a/SwiftScripts/Sources/DocumentationGenerator/main.swift b/SwiftScripts/Sources/DocumentationGenerator/main.swift new file mode 100644 index 0000000000..4543772244 --- /dev/null +++ b/SwiftScripts/Sources/DocumentationGenerator/main.swift @@ -0,0 +1,4 @@ +import Foundation + +// TODO: Create this when I can import Sourcedocs as a library. + diff --git a/Codegen/Sources/SchemaDownload/main.swift b/SwiftScripts/Sources/SchemaDownload/main.swift similarity index 90% rename from Codegen/Sources/SchemaDownload/main.swift rename to SwiftScripts/Sources/SchemaDownload/main.swift index 19f335ff2b..4ece812694 100644 --- a/Codegen/Sources/SchemaDownload/main.swift +++ b/SwiftScripts/Sources/SchemaDownload/main.swift @@ -7,11 +7,11 @@ let parentFolderOfScriptFile = FileFinder.findParentFolder() // Use that to calculate the source root let sourceRootURL = parentFolderOfScriptFile .deletingLastPathComponent() // Sources - .deletingLastPathComponent() // Codegen + .deletingLastPathComponent() // SwiftScripts .deletingLastPathComponent() // apollo-ios let cliFolderURL = sourceRootURL - .appendingPathComponent("Codegen") + .appendingPathComponent("SwiftScripts") .appendingPathComponent("ApolloCLI") let endpoint = URL(string: "http://localhost:8080/graphql")! diff --git a/Codegen/Tests/CodegenTests/CodegenTests.swift b/SwiftScripts/Tests/CodegenTests/CodegenTests.swift similarity index 100% rename from Codegen/Tests/CodegenTests/CodegenTests.swift rename to SwiftScripts/Tests/CodegenTests/CodegenTests.swift diff --git a/docs/source/api-reference.md b/docs/source/api-reference.md index 886dfc95d0..bfcf829c7f 100644 --- a/docs/source/api-reference.md +++ b/docs/source/api-reference.md @@ -30,7 +30,7 @@ sourcedocs generate \ --link-ending "/" \ -- \ -scheme Apollo \ - -workspace Apollo.xcworkspace + -project Apollo.xcodeproj ``` To generate docs for the `ApolloCodegenLib` project, `cd` into the source root and run: @@ -41,7 +41,7 @@ sourcedocs generate \ --link-ending "/" \ -- \ -scheme ApolloCodegenLib \ - -workspace Apollo.xcworkspace + -project Apollo.xcodeproj ``` @@ -53,7 +53,7 @@ sourcedocs generate \ --link-ending "/" \ -- \ -scheme ApolloSQLite \ - -workspace Apollo.xcworkspace + -project Apollo.xcodeproj ``` To generate for docs the `ApolloWebSocket` project, `cd` into the source root and run: @@ -64,7 +64,7 @@ sourcedocs generate \ --link-ending "/" \ -- \ -scheme ApolloWebSocket \ - -workspace Apollo.xcworkspace + -project Apollo.xcodeproj ``` ## From Source Instructions @@ -85,5 +85,5 @@ swift run sourcedocs generate \ --link-ending "/" \ -- \ -scheme "ApolloWebSocket" \ - -workspace "Apollo.xcworkspace" + -project "Apollo.xcodeproj" `` \ No newline at end of file