You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/22 05:28:10 UTC

[19/40] incubator-weex git commit: * [all] update travis config script

* [all] update travis config script


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/c732adbd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/c732adbd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/c732adbd

Branch: refs/heads/0.15-dev
Commit: c732adbd86da7874d0166633df1eee9da7e3ca1e
Parents: f2b4494
Author: sospartan <so...@apache.org>
Authored: Mon Jun 12 22:49:55 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Thu Jun 15 10:48:09 2017 +0800

----------------------------------------------------------------------
 .travis.yml              | 84 ++++++++++++++++++++++++++++++++-----------
 android/sdk/build.gradle |  9 ++++-
 test/ci-funcs.sh         | 18 ----------
 3 files changed, 71 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c732adbd/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 9e0e77d..23388e6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,7 @@ env:
   - TEST_SUITE=danger
   - TEST_SUITE=jsfm
   - TEST_SUITE=android
+  - TEST_SUITE=release
 matrix:
     fast_finish: true
     exclude:
@@ -24,15 +25,19 @@ matrix:
         env: TEST_SUITE=ios
       - os: linux
         env: TEST_SUITE=android
+      - os: osx
+        env: TEST_SUITE=release
+      - os: linux
+        env: TEST_SUITE=release
     include:
       - os: osx
+        env: TEST_SUITE=release
+        osx_image: xcode8.1
+        language: objective-c
+      - os: osx
         env: TEST_SUITE=ios
         osx_image: xcode8.1
         language: objective-c
-        before_script:
-          - brew update
-        script:
-          - xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6'
       - os: linux
         env: TEST_SUITE=android
         jdk: oraclejdk8
@@ -41,40 +46,77 @@ matrix:
           components:
             - platform-tools
             - tools
-            - build-tools-23.0.2
             - build-tools-23.0.3
-            - build-tools-24.0.3
-            - android-24
             - android-23
-            - android-22
             - extra-google-m2repository
             - extra-android-m2repository
             - sys-img-armeabi-v7a-android-22
-        before_script:
-          - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
-          - nvm install 7.0
-          - npm install
-        script:
-          - cd android
-          - ./run-ci.sh 
-          - cd $TRAVIS_BUILD_DIR
 cache:
   directories:
   - node_modules
   - $HOME/.m2
   - $HOME/.gradle
+before_script:
+  - |
+    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
+    fi
+  - |
+    if [[ $TEST_SUITE = "ios" ]]; then
+      brew update
+    fi
+  - |
+    if [[ $TEST_SUITE = "release" ]]; then
+      brew update
+      #manual install android sdk
+      brew cask install android-sdk
+      brew install gradle
+      export ANDROID_HOME=/usr/local/share/android-sdk
+      export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools
+      echo yes | sdkmanager platform-tools
+      echo yes | sdkmanager tools #tools
+      echo yes | sdkmanager "build-tools;23.0.3" #build-tool
+      echo yes | sdkmanager "platforms;android-23" #compile target
+      echo yes | sdkmanager "extras;android;m2repository" #support
+    fi
 script:
-  - source test/ci-funcs.sh
-  - runJSTest $TEST_SUITE
+  - |
+    if [[ $TEST_SUITE = "android" ]]; then
+      cd android
+      ./gradlew clean assembleDebug :weex_sdk:testDebugUnitTest --info -PdisableCov=true -Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError" -Dfile.encoding=UTF-8 &&
+      cd $TRAVIS_BUILD_DIR
+    fi
+  - |
+    if [[ $TEST_SUITE = "ios" ]]; then
+      xcodebuild -project ios/sdk/WeexSDK.xcodeproj test -scheme WeexSDKTests CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6'
+    fi
+  - |
+    if [[ $TEST_SUITE = "jsfm" ]]; then
+      npm run build &&
+      npm run test
+    fi
+  - |
+    if [[ $TEST_SUITE = "danger" ]]; then
+      npm run danger
+    fi
+  - |
+    if [[ $TEST_SUITE = "release" ]]; then
+      bash scripts/generate_apache_release.sh &&
+      cd apache_release_temp &&
+      bash scripts/build_from_source.sh &&
+      cd $TRAVIS_BUILD_DIR
+    fi
 notifications:
   webhooks:
     on_pull_requests: false
     urls:
       - https://oapi.dingtalk.com/robot/send?access_token=5a6be5eb6ad180fa4d04bdda0b24857ee49c3dd985361efdf0964aa9134ee623
-    on_success: change 
+    on_success: never 
     on_failure: always
   email:
     recipients:
-      - dev@weex.apache.org
-    on_success: change
+      - weexnotify@gmail.com
+    on_success: never
     on_failure: always

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c732adbd/android/sdk/build.gradle
----------------------------------------------------------------------
diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle
index 7593dbd..b807490 100755
--- a/android/sdk/build.gradle
+++ b/android/sdk/build.gradle
@@ -150,4 +150,11 @@ dependencies {
     testCompile 'org.robolectric:robolectric:3.0'
     testCompile "org.robolectric:shadows-httpclient:3.0"
     testCompile 'org.json:json:20160212'
-}
\ No newline at end of file
+}
+if(new File('../license/LICENSE').exists()){
+    license {
+        header = file('../license/LICENSE')
+        excludes(["com/taobao/weex/dom/flex/*.java"])
+    }
+    preBuild.dependsOn licenseFormat
+}

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/c732adbd/test/ci-funcs.sh
----------------------------------------------------------------------
diff --git a/test/ci-funcs.sh b/test/ci-funcs.sh
index 0719825..9353005 100644
--- a/test/ci-funcs.sh
+++ b/test/ci-funcs.sh
@@ -47,22 +47,4 @@ function printEnvInfo {
     printenv
 }
 
-function runJSTest {
-    set -e
-    target_danger='danger'
-    target_jsfm='jsfm'
-
-    target=${1:-$target_jsfm}
-    echo "cilog: target: $target"
-
-    if [ $target = $target_jsfm ]
-    then
-        npm run build
-        npm run test
-    elif [ $target = $target_danger ]
-    then
-        npm run danger
-    fi
-}
-