Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Update TravisCI for android NDK (#2319)
Browse files Browse the repository at this point in the history
* Update NDK for android travisCI

* Update danger file

* Update to ndk 16

* Update android_ndk_home environment.

* Update local.properties

* Update build.gradle

* Update travis.yml

* Update

* Update

* Update

* Update travis.yml

* update travisci

* Update travis

* Update travis.yml

* Update git file

* Update travis.yml to use NDK 20

* Update travisCI

* Update build.gradle

* Update travis

* Change to NDK 18

* Update android home

* Update ndk address

* Update zip name

* Update cache

* Update shell

* Remove empty dir.

* Update RMdir

* Speed up android build

* Update build script.
  • Loading branch information
YorkShen authored and lucky-chen committed Jul 1, 2019
1 parent c2dcc1a commit d23e29c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
51 changes: 30 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
os:
- osx
- linux
language: node_js
node_js: 7.6
rvm: 2.0.0
env:
- TEST_SUITE=danger
- TEST_SUITE=jsfm
- TEST_SUITE=android
matrix:
fast_finish: true
exclude:
- os: osx
env: TEST_SUITE=danger
- os: osx
env: TEST_SUITE=jsfm
- os: osx
env: TEST_SUITE=android
- os: linux
env: TEST_SUITE=android
include:
- os: linux
env: TEST_SUITE=android
jdk: oraclejdk8
language: android
dist: trusty
android:
components:
- platform-tools
Expand All @@ -32,18 +17,42 @@ matrix:
- android-26
- extra-google-m2repository
- extra-android-m2repository
- sys-img-armeabi-v7a-android-22
- sys-img-x86-android-26
- os: linux
env: TEST_SUITE=jsfm
- os: osx
env: TEST_SUITE=danger
cache:
directories:
- node_modules
- $HOME/.m2
- $HOME/.gradle
before_script:
- npm
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
- $HOME/android-ndk-r18b
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
install:
- |
if [[ $TEST_SUITE = "android" ]]; then
curl -o- https://github.com/raw/creationix/nvm/v0.33.2/install.sh | bash
nvm install 7.0
npm install
echo y | sdkmanager "cmake;3.6.4111459"
if find "${HOME}/android-ndk-r18b" -mindepth 1 | read; then
echo "dir not empty"
else
echo "dir empty"
rmdir "${HOME}/android-ndk-r18b"
fi
if [[ ! -d "${HOME}/android-ndk-r18b" ]]; then
wget https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip
unzip android-ndk-r18b-linux-x86_64.zip -d $HOME
fi
export ANDROID_NDK_HOME=$HOME/android-ndk-r18b
export PATH=$PATH:$ANDROID_NDK_HOME
echo "ndk.dir=$ANDROID_NDK_HOME" > android/local.properties
fi
- |
if [[ $TEST_SUITE = "jsfm" ]]; then
Expand Down
8 changes: 3 additions & 5 deletions dangerfile-android.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const getFileType = file => {

function checkAndroidFile(file){
var type = getFileType(file);
return type == type_android_test || type == type_android_sdk || type == type_jsfm;
return true
}

var hasAndroidFile = false;
Expand Down Expand Up @@ -92,10 +92,8 @@ console.log('-----------------------------hasAndroidFile------------------------
if(hasAndroidFile){
var runTryBuildCmd='source ~/.bash_profile; '
+'cd android; '
+'./gradlew clean assembleDebug --info -PdisableCov=true '
+'-Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.jvmargs="-Xmx512m '
+'-XX:+HeapDumpOnOutOfMemoryError" -Dfile.encoding=UTF-8 '
var runSuccess = shell.exec(runTryBuildCmd,{ async: false, timeout: 8 * 60 * 1000, maxBuffer: 200 * 1024 * 1024 }).code == 0;
+'./gradlew clean install --info'
var runSuccess = shell.exec(runTryBuildCmd,{ async: false, timeout: 60 * 60 * 1000, maxBuffer: 200 * 1024 * 1024 }).code == 0;
if(!runSuccess){
fail("Failed to run assembleDebug task for android.");
}
Expand Down

0 comments on commit d23e29c

Please sign in to comment.