Skip to content

Commit

Permalink
Add setup script to example app
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonjenniges committed Jul 1, 2024
1 parent fcaf1f8 commit 7f04ac5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
rm Pods && rm Podfile.lock
flutter pub get
pod install --repo-update
xcodebuild -workspace Runner.xcworkspace -configuration Debug -scheme Runner -destination "platform=iOS Simulator,OS=16.2,name=iPhone 14" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
xcodebuild -workspace Runner.xcworkspace -configuration Release -scheme Runner -sdk iphoneos SKIP_SETUP_SCRIPT=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
15 changes: 1 addition & 14 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,7 @@ This quick start guide makes the following assumptions:

### Step 3: Run the sample app for iOS

Open the Runner.xcworkspace from the example folder.

1. In the Build Phases tab for the Runner target click the + button at the top of the pane.

2. Select New Run Script Phase.

3. Pase the following into the editor panel of the new run script:

```
FRAMEWORKS="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}"
"${FRAMEWORKS}/SquareInAppPaymentsSDK.framework/setup"
```

4. Launch iOS emulator, run the flutter example from the `example` project folder:
1. Launch iOS emulator, run the flutter example from the `example` project folder:
```bash
cd <YOUR_PROJECT_DIRECTORY>/example
flutter run
Expand Down
20 changes: 19 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
5BC38C83D881270381C64576 /* [CP] Embed Pods Frameworks */,
09ACBE0189125E5E78E58F54 /* [CP] Copy Pods Resources */,
FB98E3402C208BCF00104568 /* ShellScript */,
);
buildRules = (
);
Expand All @@ -162,7 +163,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1510;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -291,6 +292,23 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
FB98E3402C208BCF00104568 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Skip the script in CI builds\nif [ \"$SKIP_SETUP_SCRIPT\" = \"YES\" ]; then\n exit 0\nfi\n\nFRAMEWORKS=\"${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}\"\n\"${FRAMEWORKS}/SquareInAppPaymentsSDK.framework/setup\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit 7f04ac5

Please sign in to comment.