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