Skip to content

Commit 41c1e42

Browse files
All conflicts resolved
1 parent c3cec6e commit 41c1e42

File tree

2 files changed

+12
-506
lines changed

2 files changed

+12
-506
lines changed

examples/demo-apps/android/LlamaDemo/setup.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77

88
set -eu
99

10+
BASEDIR=$(dirname "$0")
11+
source "$BASEDIR"/../../../../build/build_android_llm_demo.sh
12+
1013
BUILD_AAR_DIR="$(mktemp -d)"
11-
mkdir -p "${BUILD_AAR_DIR}/jni/${ANDROID_ABI}" "${BUILD_AAR_DIR}/libs"
12-
cp "${CMAKE_OUT}"/extension/android/libexecutorch_jni.so "${BUILD_AAR_DIR}/jni/${ANDROID_ABI}/libexecutorch.so"
13-
cp extension/android/build/libs/executorch.jar "${BUILD_AAR_DIR}/libs"
14-
echo \<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" \
15-
package=\"org.pytorch.executorch\"\> \
16-
\<uses-sdk android:minSdkVersion=\"19\" /\> \
17-
\</manifest\> > "${BUILD_AAR_DIR}/AndroidManifest.xml"
18-
pushd "${BUILD_AAR_DIR}"
19-
zip -r executorch-llama.aar libs jni/${ANDROID_ABI} AndroidManifest.xml
20-
popd
21-
mkdir -p examples/demo-apps/android/LlamaDemo/app/libs
22-
mv "${BUILD_AAR_DIR}/executorch-llama.aar" examples/demo-apps/android/LlamaDemo/app/libs
14+
export BUILD_AAR_DIR
15+
16+
build_jar
17+
build_android_native_library "arm64-v8a"
18+
build_android_native_library "x86_64"
19+
build_aar
20+
mkdir -p "$BASEDIR"/app/libs
21+
cp "$BUILD_AAR_DIR/executorch.aar" "$BASEDIR"/app/libs/executorch.aar

0 commit comments

Comments
 (0)