File tree Expand file tree Collapse file tree 5 files changed +28
-18
lines changed Expand file tree Collapse file tree 5 files changed +28
-18
lines changed Original file line number Diff line number Diff line change 7373          curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/app-debug.apk 
7474          curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/app-debug-androidTest.apk 
7575          curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/fp32-xnnpack-custom/model.zip 
76+           curl -o android-test-debug.apk https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/library_test_dir/executorch-debug.apk 
77+           curl -o android-test-debug-androidTest.apk https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/library_test_dir/executorch-debug-androidTest.apk 
7678          unzip model.zip 
7779          mv *.pte model.pte 
7880
Original file line number Diff line number Diff line change @@ -134,6 +134,11 @@ build_android_demo_apps() {
134134  pushd  extension/benchmark/android/benchmark
135135  ANDROID_HOME=" ${ANDROID_SDK:-/ opt/ android/ sdk} " 
136136  popd 
137+ 
138+   pushd  extension/android_test
139+   ANDROID_HOME=" ${ANDROID_SDK:-/ opt/ android/ sdk} " 
140+   ANDROID_HOME=" ${ANDROID_SDK:-/ opt/ android/ sdk} " 
141+   popd 
137142}
138143
139144collect_artifacts_to_be_uploaded () {
@@ -158,6 +163,11 @@ collect_artifacts_to_be_uploaded() {
158163  mkdir -p " ${MINIBENCH_APP_DIR} " 
159164  cp extension/benchmark/android/benchmark/app/build/outputs/apk/debug/* .apk " ${MINIBENCH_APP_DIR} " 
160165  cp extension/benchmark/android/benchmark/app/build/outputs/apk/androidTest/debug/* .apk " ${MINIBENCH_APP_DIR} " 
166+   #  Collect Java library test
167+   JAVA_LIBRARY_TEST_DIR=" ${ARTIFACTS_DIR_NAME} /library_test_dir" 
168+   mkdir -p " ${JAVA_LIBRARY_TEST_DIR} " 
169+   cp extension/android_test/build/outputs/apk/debug/* .apk " ${JAVA_LIBRARY_TEST_DIR} " 
170+   cp extension/android_test/build/outputs/apk/androidTest/debug/* .apk " ${JAVA_LIBRARY_TEST_DIR} " 
161171}
162172
163173main () {
Original file line number Diff line number Diff line change @@ -25,3 +25,8 @@ adb shell mkdir -p /data/local/tmp/llama
2525adb push model.pte /data/local/tmp/llama
2626adb push tokenizer.bin /data/local/tmp/llama
2727adb shell am instrument -w -r com.example.executorchllamademo.test/androidx.test.runner.AndroidJUnitRunner
28+ 
29+ adb install -t android-test-debug.apk
30+ adb install -t android-test-debug-androidTest.apk
31+ 
32+ adb shell am instrument -w -r org.pytorch.executorch.test/androidx.test.runner.AndroidJUnitRunner
Original file line number Diff line number Diff line change 55 * This source code is licensed under the BSD-style license found in the 
66 * LICENSE file in the root directory of this source tree. 
77 */  
8-  buildscript  {
9-     repositories {
10-         google()
11-         mavenCentral()
12-         gradlePluginPortal()
13-     }
14-     dependencies {
15-         classpath ' com.android.tools.build:gradle:7.3.0' 
16-     }
8+ plugins  {
9+   id(" com.android.application" " 8.1.0" false 
1710}
1811
19- 
20- apply plugin : ' com.android.library' 
21- 
2212group ' org.pytorch.executorch' 
2313
14+ apply plugin : " com.android.application" 
2415
2516android  {
2617    namespace ' org.pytorch.executorch' 
27-     compileSdkVersion 31 
28-     buildToolsVersion  " 29.0.0 " 
18+     compileSdk  =   34 
19+ 
2920    defaultConfig {
30-         minSdkVersion  28 
31-         targetSdkVersion  31 
21+         minSdk  =  28 
22+         targetSdk  =   33 
3223        versionCode 1 
3324        versionName " 1.0" 
3425        testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner" 
@@ -57,7 +48,7 @@ dependencies {
5748}
5849
5950task(' setupNativeLibs' type : Exec ){
60-     commandLine(" sh " " setup.sh" 
51+     commandLine(" bash " " setup.sh" 
6152}
6253
6354gradle. projectsEvaluated  {
Original file line number Diff line number Diff line change 1- #! /usr/ bin/env  bash
1+ #! /bin/bash
22#  Copyright (c) Meta Platforms, Inc. and affiliates.
33#  All rights reserved.
44# 
@@ -16,6 +16,7 @@ source "$BASEDIR"/../../build/build_android_llm_demo.sh
1616build_native_library () {
1717  ANDROID_ABI=" $1 " 
1818  CMAKE_OUT=" cmake-out-android-${ANDROID_ABI} " 
19+   ANDROID_NDK=" ${ANDROID_NDK:-/ opt/ ndk} " 
1920  EXECUTORCH_CMAKE_BUILD_TYPE=" ${EXECUTORCH_CMAKE_BUILD_TYPE:- Release} " 
2021  cmake .  -DCMAKE_INSTALL_PREFIX=" ${CMAKE_OUT} " 
2122    -DCMAKE_TOOLCHAIN_FILE=" ${ANDROID_NDK} /build/cmake/android.toolchain.cmake" 
@@ -52,6 +53,7 @@ build_jar
5253build_native_library " arm64-v8a" 
5354build_native_library " x86_64" 
5455build_aar
56+ bash examples/models/llama/install_requirements.sh
5557source  " .ci/scripts/test_llama.sh" ${BUILD_AAR_DIR} 
5658popd 
5759mkdir -p " $BASEDIR " 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments