Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename SwiftScript folder, add stub for doc generator #1033

Merged
merged 6 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ node_modules/
package-lock.json
scripts/apollo
scripts/apollo.tar.gz
Codegen/ApolloCLI
SwiftScripts/ApolloCLI
4 changes: 2 additions & 2 deletions Apollo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion Codegen/Package.swift → SwiftScripts/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ 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(
name: "Codegen",
dependencies: ["ApolloCodegenLib", "SwiftToolsSupport-auto"]),
.target(name: "SchemaDownload",
dependencies: ["ApolloCodegenLib"]),
.target(name: "DocumentationGenerator",
dependencies: []),
.testTarget(
name: "CodegenTests",
dependencies: ["Codegen"]),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions SwiftScripts/Sources/DocumentationGenerator/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Foundation

// TODO: Create this when I can import Sourcedocs as a library.

Original file line number Diff line number Diff line change
Expand Up @@ -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")!
Expand Down
10 changes: 5 additions & 5 deletions docs/source/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -41,7 +41,7 @@ sourcedocs generate \
--link-ending "/" \
-- \
-scheme ApolloCodegenLib \
-workspace Apollo.xcworkspace
-project Apollo.xcodeproj
```


Expand All @@ -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:
Expand All @@ -64,7 +64,7 @@ sourcedocs generate \
--link-ending "/" \
-- \
-scheme ApolloWebSocket \
-workspace Apollo.xcworkspace
-project Apollo.xcodeproj
```

## From Source Instructions
Expand All @@ -85,5 +85,5 @@ swift run sourcedocs generate \
--link-ending "/" \
-- \
-scheme "ApolloWebSocket" \
-workspace "Apollo.xcworkspace"
-project "Apollo.xcodeproj"
``