|
4 | 4 | - packages: |
5 | 5 | - quicktype |
6 | 6 | - rover |
| 7 | + - mint |
| 8 | + - xcbeautify |
| 9 | + - jq |
7 | 10 | - ruby |
8 | 11 | - custom: |
9 | 12 | name: Install bundle packages |
|
16 | 19 | ([ -f "./platforms/android/samples/MobileBuyIntegration/.env" ] || exit 1) |
17 | 20 | meet: cd platforms/android && ./scripts/setup_env.sh |
18 | 21 |
|
| 22 | + - custom: |
| 23 | + name: Bootstrap Mint packages |
| 24 | + met?: | |
| 25 | + set -e |
| 26 | + cd platforms/swift |
| 27 | + expected_swiftlint="$(sed -n 's#^realm/SwiftLint@##p' Mintfile)" |
| 28 | + expected_swiftformat="$(sed -n 's#^nicklockwood/SwiftFormat@##p' Mintfile)" |
| 29 | + swiftlint_bin="$(mint which swiftlint)" |
| 30 | + swiftformat_bin="$(mint which swiftformat)" |
| 31 | + test -n "$expected_swiftlint" |
| 32 | + test -n "$expected_swiftformat" |
| 33 | + test "$("$swiftlint_bin" version)" = "$expected_swiftlint" |
| 34 | + test "$("$swiftformat_bin" --version)" = "$expected_swiftformat" |
| 35 | + meet: cd platforms/swift && mint bootstrap |
| 36 | + - xcode: |
| 37 | + version: "26.2" |
| 38 | + runtimes: |
| 39 | + ios: |
| 40 | + - version: 23C54 # 26.2 |
| 41 | + architecture_variant: arm64 |
| 42 | + - custom: |
| 43 | + name: Ensure Storefront.xcconfig file |
| 44 | + met?: | |
| 45 | + ([ -f "./platforms/swift/Samples/MobileBuyIntegration/Storefront.xcconfig" ] || exit 1) |
| 46 | + meet: cd platforms/swift && ./Scripts/ensure_storefront_config |
| 47 | + - custom: |
| 48 | + name: Setup entitlements |
| 49 | + met?: | |
| 50 | + ([ -f "./platforms/swift/Samples/MobileBuyIntegration/MobileBuyIntegration/MobileBuyIntegration.entitlements" ] || exit 1;) |
| 51 | + meet: cd platforms/swift && ./Scripts/setup_entitlements |
| 52 | + |
19 | 53 | open: |
20 | 54 | "GitHub": "https://github.com/Shopify/checkout-kit" |
21 | 55 | "Issues": "https://github.com/Shopify/checkout-kit/issues" |
@@ -115,3 +149,35 @@ commands: |
115 | 149 | android-lint: |
116 | 150 | desc: Run Android lint |
117 | 151 | run: cd platforms/android && ./gradlew lintRelease |
| 152 | + |
| 153 | + # Swift |
| 154 | + swift: |
| 155 | + desc: "Swift Checkout Kit commands" |
| 156 | + subcommands: |
| 157 | + lint: |
| 158 | + desc: Check format and lint issues using SwiftLint and SwiftFormat |
| 159 | + aliases: [style] |
| 160 | + run: cd platforms/swift && ./Scripts/lint |
| 161 | + fix: |
| 162 | + desc: Automatically fix format and lint issues where possible |
| 163 | + run: cd platforms/swift && ./Scripts/lint fix |
| 164 | + build: |
| 165 | + desc: Build Swift packages or sample apps |
| 166 | + run: | |
| 167 | + echo "Usage: dev swift build {packages|samples}" |
| 168 | + subcommands: |
| 169 | + packages: |
| 170 | + desc: Build both ShopifyCheckoutKit and ShopifyAcceleratedCheckouts packages |
| 171 | + run: | |
| 172 | + cd platforms/swift |
| 173 | + ./Scripts/xcode_run build ShopifyCheckoutKit |
| 174 | + ./Scripts/xcode_run build ShopifyAcceleratedCheckouts |
| 175 | + samples: |
| 176 | + desc: Build all sample applications to verify integration |
| 177 | + run: cd platforms/swift && ./Scripts/build_samples |
| 178 | + test: |
| 179 | + desc: | |
| 180 | + `dev swift test` - Run all tests for the ShopifyCheckoutKit-Package. |
| 181 | + `dev swift test <test_class_name>` - Run only the specified test class. |
| 182 | + syntax: "[test_class_name]" |
| 183 | + run: cd platforms/swift && ./Scripts/xcode_run test ShopifyCheckoutKit-Package "$1" |
0 commit comments