From 5e236b56e056284967c589a0295ab43084d8f4ac Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Sun, 30 Jun 2019 03:22:41 +0000 Subject: [PATCH] Add build.gradle for QA --- .gitlab-ci.yml | 4 +++ paddle/fluid/lite/CMakeLists.txt | 2 ++ paddle/fluid/lite/demo/java/README.md | 2 +- .../fluid/lite/demo/java/android/.gitignore | 1 - .../android/PaddlePredictor/app/build.gradle | 30 +++++++++++++++++++ .../java/android/PaddlePredictor/build.gradle | 29 ++++++++++++++++++ 6 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 paddle/fluid/lite/demo/java/android/PaddlePredictor/app/build.gradle create mode 100644 paddle/fluid/lite/demo/java/android/PaddlePredictor/build.gradle diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d975b2afc9..15859581eb 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,8 +12,12 @@ before_script: # merge the latest code - git config --global user.email "you@example.com" - git config --global user.name "Your Name" + - git reset --hard HEAD # ignore any local changes in CI node. - git fetch origin incubate/lite + - git status -s + - git branch - git merge --no-ff origin/incubate/lite + #- git checkout origin/incubate/lite && git log -1 && image: $SERVER_LITE_DOCKER_IMAGE diff --git a/paddle/fluid/lite/CMakeLists.txt b/paddle/fluid/lite/CMakeLists.txt index 27aa12bb0f..470e52e53a 100644 --- a/paddle/fluid/lite/CMakeLists.txt +++ b/paddle/fluid/lite/CMakeLists.txt @@ -101,6 +101,8 @@ file(WRITE ${offline_lib_registry_file} "") # clean set(__lite_cc_files "" ; "") set(__lite_cc_files "${CMAKE_BINARY_DIR}/lite_cc_files.txt") file(WRITE ${__lite_cc_files} "") # clean + + # cc_library with branch support. # The branches: # X86_DEPS: works only when LITE_WITH_X86 is ON. diff --git a/paddle/fluid/lite/demo/java/README.md b/paddle/fluid/lite/demo/java/README.md index 3287706dac..f6e748a3c4 100644 --- a/paddle/fluid/lite/demo/java/README.md +++ b/paddle/fluid/lite/demo/java/README.md @@ -12,7 +12,7 @@ ## 手动编译(给测试人员需要更新 demo 模型或 .so 库可阅读) -###编译: +### 编译: 首先在PaddleLite的开发Docker镜像中,拉取最新PaddleLite代码,编译对应你手机架构的预测库, 下面我们以arm8 架构举例。进入paddlelite 目录,运行以下cmake 和make 命令: diff --git a/paddle/fluid/lite/demo/java/android/.gitignore b/paddle/fluid/lite/demo/java/android/.gitignore index 2b75303ac5..d945664de1 100644 --- a/paddle/fluid/lite/demo/java/android/.gitignore +++ b/paddle/fluid/lite/demo/java/android/.gitignore @@ -1,5 +1,4 @@ *.iml -.gradle /local.properties /.idea/caches /.idea/libraries diff --git a/paddle/fluid/lite/demo/java/android/PaddlePredictor/app/build.gradle b/paddle/fluid/lite/demo/java/android/PaddlePredictor/app/build.gradle new file mode 100644 index 0000000000..09134f7e7f --- /dev/null +++ b/paddle/fluid/lite/demo/java/android/PaddlePredictor/app/build.gradle @@ -0,0 +1,30 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 28 + defaultConfig { + applicationId "com.baidu.paddle.lite" + minSdkVersion 23 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support.constraint:constraint-layout:1.1.3' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} + + diff --git a/paddle/fluid/lite/demo/java/android/PaddlePredictor/build.gradle b/paddle/fluid/lite/demo/java/android/PaddlePredictor/build.gradle new file mode 100644 index 0000000000..ec235fca71 --- /dev/null +++ b/paddle/fluid/lite/demo/java/android/PaddlePredictor/build.gradle @@ -0,0 +1,29 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + google() + jcenter() + + } + dependencies { + classpath 'com.android.tools.build:gradle:3.4.1' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + google() + jcenter() + + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} + + -- GitLab