Skip to content

Commit bfa62db

Browse files
committed
support for macos
1 parent bfe6b8c commit bfa62db

File tree

5 files changed

+19
-21
lines changed

5 files changed

+19
-21
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"build": "turbo run build",
77
"build:android": "./scripts/build-native-lib.sh android",
8-
"build:ios": "./scripts/build-native-lib.sh ios",
8+
"build:apple": "./scripts/build-native-lib.sh apple",
99
"format": "concurrently 'yarn:format:*'",
1010
"format:c": "clang-format -i $(git ls-files '*.cpp' '*.h' '*.m' '*.mm') --style file:.config/.clang-format",
1111
"format:js": "prettier --write $(git ls-files '*.js' '*.json' '*.ts' '*.tsx' '*.yml' 'README.md')",

scripts/build-native-lib.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ ANDROID_OUTPUT_DIR="$MODULE_NAME/build"
1010
ANDROID_RN_OUTPUT_DIR="$RN_MODULE_DIR/android"
1111
ANDROID_PUBLISH_TASK="publishAndroidPublicationToLocalRepoRepository"
1212

13-
IOS_BUILD_TASK="assembleSharedAsyncStorageXCFramework"
14-
IOS_OUTPUT_NAME="SharedAsyncStorage.xcframework"
15-
IOS_OUTPUT_DIR="$MODULE_NAME/build/XCFrameworks/release"
16-
IOS_RN_OUTPUT_DIR="$RN_MODULE_DIR/ios/Frameworks"
13+
APPLE_BUILD_TASK="assembleSharedAsyncStorageXCFramework"
14+
APPLE_OUTPUT_NAME="SharedAsyncStorage.xcframework"
15+
APPLE_OUTPUT_DIR="$MODULE_NAME/build/XCFrameworks/release"
16+
APPLE_RN_OUTPUT_DIR="$RN_MODULE_DIR/apple/Frameworks"
1717

1818

1919

@@ -32,17 +32,17 @@ build_android() {
3232
echo "all done"
3333
}
3434

35-
build_ios() {
36-
echo "👷 Assembling ios shared-storage"
37-
./gradlew :$MODULE_NAME:$IOS_BUILD_TASK
35+
build_apple() {
36+
echo "👷 Assembling apple shared-storage"
37+
./gradlew :$MODULE_NAME:$APPLE_BUILD_TASK
3838

3939

4040
echo "recreate Frameworks dir"
41-
rm -rf $IOS_RN_OUTPUT_DIR
42-
mkdir $IOS_RN_OUTPUT_DIR
41+
rm -rf $APPLE_RN_OUTPUT_DIR
42+
mkdir $APPLE_RN_OUTPUT_DIR
4343

4444
echo "move xcframework to RN module"
45-
mv $IOS_OUTPUT_DIR/$IOS_OUTPUT_NAME $IOS_RN_OUTPUT_DIR/$IOS_OUTPUT_NAME
45+
mv $APPLE_OUTPUT_DIR/$APPLE_OUTPUT_NAME $APPLE_RN_OUTPUT_DIR/$APPLE_OUTPUT_NAME
4646
echo "all done"
4747
}
4848

@@ -52,14 +52,14 @@ case "$TARGET" in
5252
android)
5353
build_android
5454
;;
55-
ios)
56-
build_ios
55+
apple)
56+
build_apple
5757
;;
5858
all)
5959
build_all
6060
;;
6161
*)
62-
echo "Usage: $0 {android|ios}"
62+
echo "Usage: $0 {android|apple}"
6363
exit 1
6464
;;
6565
esac

shared-storage/build.gradle.kts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ kotlin {
3333

3434
val xcfName = "SharedAsyncStorage"
3535
val xcf = XCFramework(xcfName)
36-
listOf(iosX64(), iosArm64(), iosSimulatorArm64()).forEach {
36+
listOf(iosX64(), iosArm64(), iosSimulatorArm64(), macosArm64(), macosX64()).forEach {
3737
it.binaries.framework {
3838
baseName = xcfName
3939
xcf.add(this)
@@ -54,7 +54,7 @@ kotlin {
5454

5555
androidMain { dependencies {} }
5656

57-
iosMain { dependencies {} }
57+
appleMain { dependencies {} }
5858

5959
jvmMain { dependencies {} }
6060

@@ -81,15 +81,13 @@ kotlin {
8181
add("kspIosSimulatorArm64", libs.androidx.room.compiler)
8282
add("kspIosX64", libs.androidx.room.compiler)
8383
add("kspIosArm64", libs.androidx.room.compiler)
84+
add("kspMacosX64", libs.androidx.room.compiler)
85+
add("kspMacosArm64", libs.androidx.room.compiler)
8486
add("kspJvm", libs.androidx.room.compiler)
8587
}
8688
}
8789

88-
skie {
89-
build {
90-
produceDistributableFramework()
91-
}
92-
}
90+
skie { build { produceDistributableFramework() } }
9391

9492
publishing {
9593
repositories {
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)