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

add advanced codegen tip using a temporary file #881

Merged
merged 1 commit into from Nov 5, 2019

Conversation

@koenpunt
Copy link
Contributor

koenpunt commented Nov 4, 2019

In addition to letting Xcode to decide whether or not to run the codegen based on input and output files, you can also decide to first write the file to a temporary location, and then compare this temporary file to the current one. And then only when the files differ you move the temporary file into place.

@@ -267,14 +269,29 @@ For example, if you're using something like this to run your code generation for
"${SCRIPT_PATH}"/run-bundled-codegen.sh codegen:generate --target=swift --includes=./**/*.graphql --localSchemaFile="schema.json" API.swift
```

Assuming youv'e set the script out to run from `$(SRCROOT)/YourTarget`, you can add `$(SRCROOT)/YourTarget/**/*.graphql` (the path you're running it from + the glob you're passing to the `includes` CLI parameter) to the list of `Input Files` for your Apollo Run Script Build phase. Then you can add `$(SRCROOT)/YourTarget/API.swift` (the path you're running it from + the output file) to the list of `Output Files`:
Assuming you've set the script out to run from `$(SRCROOT)/YourTarget`, you can add `$(SRCROOT)/YourTarget/**/*.graphql` (the path you're running it from + the glob you're passing to the `includes` CLI parameter) to the list of `Input Files` for your Apollo Run Script Build phase. Then you can add `$(SRCROOT)/YourTarget/API.swift` (the path you're running it from + the output file) to the list of `Output Files`:

This comment has been minimized.

Copy link
@designatednerd

designatednerd Nov 4, 2019

Collaborator

🤦‍♀️good catch

docs/source/installation.md Show resolved Hide resolved
@koenpunt koenpunt force-pushed the koenpunt:patch-2 branch from c31119b to 04ea563 Nov 5, 2019
@designatednerd designatednerd merged commit ec985ba into apollographql:master Nov 5, 2019
15 checks passed
15 checks passed
CLA Author has signed the Apollo CLA.
Details
ci/circleci: Apollo iOS 11.4 Your tests passed on CircleCI!
Details
ci/circleci: Apollo iOS 12.4 Your tests passed on CircleCI!
Details
ci/circleci: Apollo iOS 13.1 Your tests passed on CircleCI!
Details
ci/circleci: Apollo macOS 10.15 Your tests passed on CircleCI!
Details
ci/circleci: Apollo tvOS 13.0 Your tests passed on CircleCI!
Details
ci/circleci: ApolloSQLite iOS 11.4 Your tests passed on CircleCI!
Details
ci/circleci: ApolloSQLite iOS 12.4 Your tests passed on CircleCI!
Details
ci/circleci: ApolloSQLite iOS 13.1 Your tests passed on CircleCI!
Details
ci/circleci: ApolloSQLite macOS 10.15 Your tests passed on CircleCI!
Details
ci/circleci: ApolloWebSocket iOS 11.4 Your tests passed on CircleCI!
Details
ci/circleci: ApolloWebSocket iOS 12.4 Your tests passed on CircleCI!
Details
ci/circleci: ApolloWebSocket iOS 13.1 Your tests passed on CircleCI!
Details
ci/circleci: ApolloWebSocket macOS 10.15 Your tests passed on CircleCI!
Details
netlify/apollo-ios-docs/deploy-preview Deploy preview ready!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.