-
Notifications
You must be signed in to change notification settings - Fork 743
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
update integration instructions for Cocoapods #420
Conversation
fixes issues such as apollographql#412 In case of an installation via Cocoapods, the path to the `check-and-run-apollo-codegen.sh` script can be deduced without searching through `$FRAMEWORK_SEARCH_PATHS`
@arielelkin: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
If you're using Cocoapods: | ||
```sh | ||
set -exu | ||
sh $PODS_ROOT/Apollo/scripts/check-and-run-apollo-codegen.sh generate $(find . -name '*.graphql') --schema 'path/to/your/schema.json' --output ApolloAPI.swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check-and-run-apollo-codegen.sh
doesn't seem to be part of the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also running into an issue with FRAMEWORK_SEARCH_PATHS, though this doesn't fix the issue for me. |
This script covers both MacOS cases and seems to be getting me closer: APOLLO_FRAMEWORK_PATH="$(eval find $FRAMEWORK_SEARCH_PATHS -name "Apollo.framework" -maxdepth 1)"
if [ -n "$APOLLO_FRAMEWORK_PATH" ]; then
APOLLO_CLI=$APOLLO_FRAMEWORK_PATH/Versions/Current/Resources/check-and-run-apollo-cli.sh
elif [ -d "$PODS_ROOT" ]; then
if [ -d "$PODS_ROOT/Apollo" ]; then
APOLLO_CLI=$PODS_ROOT/Apollo/scripts/check-and-run-apollo-cli.sh
else
echo "error: Couldn't find Apollo in Cocoapods or FRAMEWORK_SEARCH_PATHS; make sure to add it to your project."
exit 1
fi
else
echo "error: Couldn't find Apollo in FRAMEWORK_SEARCH_PATHS; make sure to add the framework to your project."
exit 1
fi
cd "${SRCROOT}/${TARGET_NAME}"
$APOLLO_CLI codegen:generate --queries="$(find . -name '*.graphql')" --schema=schema.json API.swift |
In any case, if you're installing via Cocoapods, the path to the scripts can and should be inferred from the |
@paulmelnikow @martijnwalraven any updates? |
I'm going to close this one out in favor of #610 - there's some stuff that should now be fixed with the framework search paths there as well. |
fixes issues such as #412
In case of an installation via Cocoapods, the path to the
check-and-run-apollo-codegen.sh
script can be deduced without searching through$FRAMEWORK_SEARCH_PATHS