You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by lu...@apache.org on 2019/07/01 03:29:22 UTC

[incubator-weex] branch master updated: Update TravisCI for android NDK (#2319)

This is an automated email from the ASF dual-hosted git repository.

luckychen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new d23e29c  Update TravisCI for android NDK (#2319)
d23e29c is described below

commit d23e29c0588d7ef1f15b7d2ff4cbb755d8d2fb4d
Author: YorkShen <sh...@gmail.com>
AuthorDate: Mon Jul 1 11:29:17 2019 +0800

    Update TravisCI for android NDK (#2319)
    
    * 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.
---
 .travis.yml           | 51 ++++++++++++++++++++++++++++++---------------------
 dangerfile-android.js |  8 +++-----
 2 files changed, 33 insertions(+), 26 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 0f9cfb6..de89b2b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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
@@ -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://raw.githubusercontent.com/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
diff --git a/dangerfile-android.js b/dangerfile-android.js
index ef2a29b..c218407 100644
--- a/dangerfile-android.js
+++ b/dangerfile-android.js
@@ -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;
@@ -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.");
   }