Skip to content

Commit 28cc65b

Browse files
committed
[RNE Rewrite] chore: adapt packaging to rewrite's native consumption
core-android/core-ios drop the separately-shipped pthreadpool+cpuinfo (statically linked into libexecutorch.so / libthreadpool_*.a for the rewrite), and the ABI-independent executorch.jar rides in the core-android-arm64 artifact (downloaded to third-party, not committed).
1 parent 45ec2cb commit 28cc65b

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

packages/react-native-executorch/android/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,10 @@ dependencies {
119119
// React Native Android Engine
120120
implementation("com.facebook.react:react-android")
121121

122-
// The ExecuTorch Java/Kotlin wrapper (ABI-independent, committed in the
123-
// android module since it is not part of the per-ABI download artifacts).
124-
implementation(files("libs/executorch.jar"))
122+
// The ExecuTorch Java API (ABI-independent). Downloaded (not committed) — it
123+
// rides in the core-android-arm64-v8a artifact, extracted by download-libs.js
124+
// to third-party/android/libs/executorch.jar.
125+
implementation(files("../third-party/android/libs/executorch.jar"))
125126

126127
// Recommended for modern Kotlin Android development
127128
implementation("androidx.core:core-ktx:1.12.0")

packages/react-native-executorch/scripts/package-release-artifacts.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,19 @@ package_merged "headers" \
153153
echo ""
154154
echo "Android:"
155155

156-
package_merged "core-android-arm64-v8a" \
157-
"executorch/arm64-v8a" "$ANDROID_LIBS/executorch/arm64-v8a" \
158-
"pthreadpool/arm64-v8a" "$ANDROID_LIBS/pthreadpool/arm64-v8a" \
159-
"cpuinfo/arm64-v8a" "$ANDROID_LIBS/cpuinfo/arm64-v8a"
156+
# core-android bundles the per-ABI executorch .so. pthreadpool + cpuinfo are
157+
# statically linked into libexecutorch.so (not shipped separately). The
158+
# ABI-independent executorch.jar (ExecuTorch Java API for the JNI bridge) rides
159+
# along in the arm64 core tarball, which is always downloaded.
160+
echo " → core-android-arm64-v8a"
161+
_ca_tmp=$(mktemp -d)
162+
mkdir -p "$_ca_tmp/executorch/arm64-v8a"
163+
cp -r "$ANDROID_LIBS/executorch/arm64-v8a/." "$_ca_tmp/executorch/arm64-v8a/"
164+
cp "$ANDROID_LIBS/executorch.jar" "$_ca_tmp/executorch.jar"
165+
tar -czf "$OUT/core-android-arm64-v8a.tar.gz" -C "$_ca_tmp" .
166+
shasum -a 256 "$OUT/core-android-arm64-v8a.tar.gz" | awk '{print $1}' > "$OUT/core-android-arm64-v8a.tar.gz.sha256"
167+
echo "$(du -sh "$OUT/core-android-arm64-v8a.tar.gz" | cut -f1)"
168+
rm -rf "$_ca_tmp"
160169

161170
package_merged "core-android-x86_64" \
162171
"executorch/x86_64" "$ANDROID_LIBS/executorch/x86_64"
@@ -191,11 +200,11 @@ package_file "vulkan-android-x86_64" \
191200
echo ""
192201
echo "iOS:"
193202

203+
# pthreadpool + cpuinfo are bundled into libthreadpool_*.a (in libs/executorch),
204+
# so no separate libs/pthreadpool or libs/cpuinfo dirs are shipped.
194205
package_merged "core-ios" \
195206
"ExecutorchLib.xcframework" "$IOS_DIR/ExecutorchLib.xcframework" \
196-
"libs/executorch" "$IOS_DIR/libs/executorch" \
197-
"libs/pthreadpool" "$IOS_DIR/libs/pthreadpool" \
198-
"libs/cpuinfo" "$IOS_DIR/libs/cpuinfo"
207+
"libs/executorch" "$IOS_DIR/libs/executorch"
199208

200209
# phonemis is built from in-tree source (third-party/common/phonemis submodule);
201210
# no iOS tarball is produced.

0 commit comments

Comments
 (0)