diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e49a7dc0cfec2f172044c2c01e840546aefa1e1f..3fab75003f85aa347337f1b9580d966a1a704b69 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,7 @@ stages: - ops_test - api_test - python_tools_tests + - build_android_demo - ops_benchmark - extra_tests @@ -111,3 +112,8 @@ python_tools_tests: python tools/converter.py run --config=${CONF_FILE} --round=1 --validate --model_graph_format=file --model_data_format=file || exit 1; python tools/converter.py run --config=${CONF_FILE} --example --round=1 --validate --model_graph_format=file --model_data_format=file || exit 1; - rm -rf mace-models + +build_android_demo: + stage: build_android_demo + script: + - pushd mace/examples/android/ && bash build.sh build && popd diff --git a/mace/examples/android/app/build.gradle b/mace/examples/android/app/build.gradle index a1f68ed3266e21b7f45cd128db5f668fbaa813c1..3bd3b6c780fff30ae75288a88def5e4d49790a11 100644 --- a/mace/examples/android/app/build.gradle +++ b/mace/examples/android/app/build.gradle @@ -10,6 +10,10 @@ android { versionName "1.0" } + lintOptions { + abortOnError false + } + signingConfigs { release { storeFile file("mace_demo.jks") diff --git a/mace/examples/android/build.sh b/mace/examples/android/build.sh index b7b08eedf15fc0cbf968c4ca04a9c838bf42cf47..46a6e4c2efb446a7c5ec25bbaef9ac1c7807e5c6 100755 --- a/mace/examples/android/build.sh +++ b/mace/examples/android/build.sh @@ -9,8 +9,13 @@ cp -rf builds/mobilenet/include mace/examples/android/macelibrary/src/main/cpp/ cp -rf builds/mobilenet/model mace/examples/android/macelibrary/src/main/cpp/ bash tools/build-standalone-lib.sh +cp -rf builds/include mace/examples/android/macelibrary/src/main/cpp/ cp -rf builds/lib mace/examples/android/macelibrary/src/main/cpp/ popd -./gradlew installAppRelease +if [ $# -eq 1 ] && [ $1 == "build" ]; then + ./gradlew build +else + ./gradlew installAppRelease +fi diff --git a/mace/examples/android/macelibrary/CMakeLists.txt b/mace/examples/android/macelibrary/CMakeLists.txt index 76c5e30e696094b8a96c0f53849520e313ac7c52..fbdb60c55f94a5c83882f2e525b525ef51a21018 100644 --- a/mace/examples/android/macelibrary/CMakeLists.txt +++ b/mace/examples/android/macelibrary/CMakeLists.txt @@ -14,12 +14,12 @@ cmake_minimum_required(VERSION 3.4.1) include_directories(${CMAKE_SOURCE_DIR}/) include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include) -set(mace_file ${CMAKE_SOURCE_DIR}/src/main/cpp/lib/arm64-v8a/libmace.a) -set(mobilenet_file ${CMAKE_SOURCE_DIR}/src/main/cpp/model/mobilenet.a) +set(mace_lib ${CMAKE_SOURCE_DIR}/src/main/cpp/lib/arm64-v8a/libmace.a) +set(mobilenet_lib ${CMAKE_SOURCE_DIR}/src/main/cpp/model/arm64-v8a/mobilenet.a) add_library (mace_lib STATIC IMPORTED) -set_target_properties(mace_lib PROPERTIES IMPORTED_LOCATION ${mace_file}) +set_target_properties(mace_lib PROPERTIES IMPORTED_LOCATION ${mace_lib}) add_library (mobilenet_lib STATIC IMPORTED) -set_target_properties(mobilenet_lib PROPERTIES IMPORTED_LOCATION ${mobilenet_file}) +set_target_properties(mobilenet_lib PROPERTIES IMPORTED_LOCATION ${mobilenet_lib}) add_library( # Sets the name of the library. mace_mobile_jni