Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions build/test_android_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ build_android_native_library() {
pushd examples/demo-apps/android/LlamaDemo
CMAKE_OUT="cmake-out-android-$1" ANDROID_NDK=/opt/ndk ANDROID_ABI="$1" ./gradlew setup
popd
cp "cmake-out-android-$1"/extension/android/*.so build_aar/jni/$1/
}

build_android_demo_app() {
Expand All @@ -37,8 +38,27 @@ build_android_llama_demo_app() {
popd
}

build_aar() {
cp extension/android/build/libs/executorch.jar build_aar/libs
echo \<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" \
package=\"org.pytorch.executorch\"\> \
\<uses-sdk android:minSdkVersion=\"19\" /\> \
\</manifest\> > build_aar/AndroidManifest.xml
pushd build_aar
mv jni/arm64-v8a/libexecutorch_jni.so jni/arm64-v8a/libexecutorch.so
mv jni/x86_64/libexecutorch_jni.so jni/x86_64/libexecutorch.so
zip -r executorch.aar libs jni AndroidManifest.xml

rm jni/arm64-v8a/libexecutorch.so jni/x86_64/libexecutorch.so
zip -r executorch-llama.aar libs jni AndroidManifest.xml
popd
}

mkdir -p build_aar/jni/arm64-v8a build_aar/jni/x86_64 build_aar/libs

build_android_native_library arm64-v8a
build_android_native_library x86_64
export_model
build_android_demo_app
build_android_llama_demo_app
build_aar