Skip to content

Commit 9aa83c5

Browse files
Add build command for native android local maven module (#395)
1 parent a74f42b commit 9aa83c5

File tree

9 files changed

+77
-8
lines changed

9 files changed

+77
-8
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ jobs:
9191
- name: Checkout
9292
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
9393

94+
- name: Checkout checkout-sheet-kit-android
95+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
96+
with:
97+
repository: Shopify/checkout-sheet-kit-android
98+
ref: prototype/development
99+
path: checkout-sheet-kit-android
100+
94101
- name: Setup
95102
uses: ./.github/actions/setup
96103

@@ -101,6 +108,12 @@ jobs:
101108
distribution: 'zulu'
102109
java-version: ${{ env.JAVA_VERSION }}
103110

111+
- name: Publish Android SDK to Maven Local
112+
env:
113+
GRADLE_OPTS: -Xmx4g -XX:MaxMetaspaceSize=768m
114+
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
115+
run: ./scripts/publish_android_snapshot ./checkout-sheet-kit-android
116+
104117
- name: Run Android tests
105118
timeout-minutes: 20
106119
env:
@@ -110,7 +123,7 @@ jobs:
110123
echo "JAVA_HOME: $JAVA_HOME"
111124
java -version
112125
javac -version
113-
echo "STOREFRONT_DOMAIN=myshopify.com" > sample/.env
126+
cp sample/.env.example sample/.env
114127
yarn module build
115128
yarn sample test:android --no-daemon
116129
@@ -119,10 +132,19 @@ jobs:
119132
runs-on: macos-26-xlarge
120133
timeout-minutes: 20
121134
needs: [lint, test]
135+
env:
136+
SWIFT_SDK_PATH: ${{ github.workspace }}/checkout-sheet-kit-swift
122137
steps:
123138
- name: Checkout
124139
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
125140

141+
- name: Checkout checkout-sheet-kit-swift
142+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
143+
with:
144+
repository: Shopify/checkout-sheet-kit-swift
145+
ref: prototype/development
146+
path: checkout-sheet-kit-swift
147+
126148
- name: Display Current Xcode Information
127149
run: |
128150
echo "Xcode Path: $(xcode-select -p)"
@@ -133,8 +155,21 @@ jobs:
133155
- name: Setup
134156
uses: ./.github/actions/setup
135157

158+
- name: Setup sample environment
159+
run: |
160+
cp sample/.env.example sample/.env
161+
yarn env-to-xcconfig
162+
136163
- name: Install cocoapods
137164
uses: ./.github/actions/install-cocoapods
165+
continue-on-error: true
166+
167+
- name: Update pods for local Swift SDK
168+
run: |
169+
cd sample
170+
bundle install
171+
cd ios
172+
bundle exec pod install --repo-update
138173
139174
- name: Run Swift tests
140175
run: |

dev.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ type: node
66

77
up:
88
- packages:
9-
- swiftlint
10-
- ccache
9+
- swiftlint
10+
- ccache
1111
- ruby
1212
- xcode:
1313
version: '26.0'
@@ -24,7 +24,9 @@ up:
2424
yarn
2525
- custom:
2626
name: Generate iOS xcconfig from env
27-
met?: test -f sample/ios/JSEnvironment.xcconfig && test sample/.env -ot sample/ios/JSEnvironment.xcconfig
27+
met?:
28+
test -f sample/ios/JSEnvironment.xcconfig && test sample/.env -ot
29+
sample/ios/JSEnvironment.xcconfig
2830
meet: |
2931
yarn env-to-xcconfig
3032
- custom:
@@ -49,6 +51,11 @@ check:
4951
lint_sample: yarn sample lint
5052

5153
commands:
54+
build:
55+
desc: Builds the Typescript and Android package for local development
56+
run: |
57+
yarn module build
58+
yarn build:android
5259
5360
server:
5461
desc: 'Start development server'

modules/@shopify/checkout-sheet-kit/android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ android {
8383
}
8484

8585
repositories {
86+
mavenLocal()
8687
mavenCentral()
8788
google()
8889
}

modules/@shopify/checkout-sheet-kit/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ ndkVersion=23.1.7779620
55
buildToolsVersion = "35.0.0"
66

77
# Version of Shopify Checkout SDK to use with React Native
8-
SHOPIFY_CHECKOUT_SDK_VERSION=3.5.3
8+
SHOPIFY_CHECKOUT_SDK_VERSION=4.0.0-SNAPSHOT

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"modules/**/*"
1616
],
1717
"scripts": {
18+
"build:android": "./scripts/publish_android_snapshot",
1819
"clean": "rm -rf node_modules; watchman watch-del . || true",
1920
"sample": "yarn workspace sample",
2021
"module": "yarn workspace @shopify/checkout-sheet-kit",

sample/android/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ buildscript {
99
kotlinVersion = "2.1.20"
1010
}
1111
repositories {
12+
mavenLocal()
1213
google()
1314
mavenCentral()
1415
}
@@ -29,6 +30,14 @@ def loadProperties() {
2930

3031
apply plugin: "com.facebook.react.rootproject"
3132

33+
allprojects {
34+
repositories {
35+
mavenLocal()
36+
google()
37+
mavenCentral()
38+
}
39+
}
40+
3241
// Configure memory for forked test JVMs to avoid OOMs in CI
3342
subprojects {
3443
tasks.withType(Test).configureEach {

sample/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ newArchEnabled=true
4141
hermesEnabled=true
4242

4343
# Note: only used here for testing
44-
SHOPIFY_CHECKOUT_SDK_VERSION=3.5.3
44+
SHOPIFY_CHECKOUT_SDK_VERSION=4.0.0-SNAPSHOT

sample/ios/Podfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ target 'ReactNative' do
3232
pod "RNShopifyCheckoutSheetKit", :path => "../../modules/@shopify/checkout-sheet-kit"
3333

3434
# Adjust these to point to where you cloned checkout-sheet-kit-swift
35-
pod "ShopifyCheckoutSheetKit", :path => "~/src/github.com/Shopify/checkout-sheet-kit-swift"
36-
pod "ShopifyCheckoutSheetKit/AcceleratedCheckouts", :path => "~/src/github.com/Shopify/checkout-sheet-kit-swift"
35+
# Can be overridden via SWIFT_SDK_PATH env var (used in CI)
36+
swift_sdk_path = ENV['SWIFT_SDK_PATH'] || "~/src/github.com/Shopify/checkout-sheet-kit-swift"
37+
pod "ShopifyCheckoutSheetKit", :path => swift_sdk_path
38+
pod "ShopifyCheckoutSheetKit/AcceleratedCheckouts", :path => swift_sdk_path
3739

3840
target 'ReactNativeTests' do
3941
inherit! :complete

scripts/publish_android_snapshot

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SDK_PATH="${1:-$HOME/src/github.com/Shopify/checkout-sheet-kit-android}"
5+
VERSION="${2:-4.0.0-SNAPSHOT}"
6+
7+
if [ ! -d "$SDK_PATH" ]; then
8+
echo "Error: checkout-sheet-kit-android not found at $SDK_PATH"
9+
exit 1
10+
fi
11+
12+
cd "$SDK_PATH"
13+
CHECKOUT_SHEET_KIT_VERSION="$VERSION" ./gradlew :lib:publishToMavenLocal
14+
echo "Published $VERSION to Maven local"

0 commit comments

Comments
 (0)