diff --git a/README.md b/README.md index 2fb87ed7..ea0ac48b 100644 --- a/README.md +++ b/README.md @@ -36,31 +36,17 @@ fi ``` -- There should also be another run script labeled **UpliftAPI** If not, create a **New Run Script Phase** with the following script: - -```bash -CLI_PATH="./Pods/Apollo/apollo-ios-cli" -SECRETS_PATH="${SRCROOT}/TransitSecrets" - -if [ "${CONFIGURATION}" != "Release" ]; then - CONFIG_PATH="${SECRETS_PATH}/uplift-codegen-config-dev.json" -fi - -if [ "${CONFIGURATION}" = "Release" ]; then - CONFIG_PATH="${SECRETS_PATH}/uplift-codegen-config-prod.json" -fi +5. Select the `TCAT Debug` schema to use our development server and `TCAT Release` to use our production server. +6. Generate the Uplift API: -"${CLI_PATH}" generate -p "${CONFIG_PATH}" -f +- Dev: `./Pods/Apollo/apollo-ios-cli generate -p "TransitSecrets/uplift-codegen-config-dev.json" -f` +- Prod: `./Pods/Apollo/apollo-ios-cli generate -p "TransitSecrets/uplift-codegen-config-prod.json" -f` -``` - -5. Select the `TCAT Debug` schema to use our development server and `TCAT Release` to use our production server. -6. Generate the Uplift API with the following command: `./Pods/Apollo/apollo-ios-cli generate -p "TransitSecrets/uplift-codegen-config-dev.json" -f` 7. Build the project and you should be good to go. ## Common Issues -- If the build script for generating the API folder doesn't work, you can manually generate the API via `./Pods/Apollo/apollo-ios-cli generate -p "TransitSecrets/uplift-codegen-config-dev.json" -f` +- If the API is not working properly, try manually generating the API with the CLI. - If UpliftAPI is not detected or if your new written queries/mutations are not generated by Apollo, make sure that the generated UpliftAPI folder is linked to the TCAT target. You can do this by simply deleting the UpliftAPI group via the project navigator on Xcode and dragging the generated UpliftAPI folder from Finder to Xcode. diff --git a/TCAT.xcodeproj/project.pbxproj b/TCAT.xcodeproj/project.pbxproj index 3150cc59..7dfabf64 100644 --- a/TCAT.xcodeproj/project.pbxproj +++ b/TCAT.xcodeproj/project.pbxproj @@ -622,7 +622,6 @@ 2292F9DB215722ED00C8C931 /* SwiftLint */, 7E14AED52177E846006A344D /* Embed Foundation Extensions */, CE26CBF62B879837005D099A /* Crashlytics */, - 2E9416612BC60AE7003DEB44 /* UpliftAPI */, 882B9E91268F347446806E32 /* [CP] Embed Pods Frameworks */, 0B4CA64206AF6DA1763F9ACB /* [CP] Copy Pods Resources */, ); @@ -743,25 +742,6 @@ shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\"\n\nif which swiftlint >/dev/null; then\n swiftlint --fix && swiftlint\nelse\n echo \"WARNING: SwiftLint not installed\"\nfi\n"; }; - 2E9416612BC60AE7003DEB44 /* UpliftAPI */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = UpliftAPI; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "CLI_PATH=\"./Pods/Apollo/apollo-ios-cli\"\nSECRETS_PATH=\"${SRCROOT}/TransitSecrets\"\n\nif [ \"${CONFIGURATION}\" != \"Release\" ]; then\n CONFIG_PATH=\"${SECRETS_PATH}/uplift-codegen-config-dev.json\"\nfi\n\nif [ \"${CONFIGURATION}\" = \"Release\" ]; then\n CONFIG_PATH=\"${SECRETS_PATH}/uplift-codegen-config-prod.json\"\nfi\n\n\"${CLI_PATH}\" generate -p \"${CONFIG_PATH}\" -f\n"; - }; 882B9E91268F347446806E32 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647;