weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ky...@apache.org
Subject [10/14] incubator-weex git commit: * [test] rebase android jacoco test files
Date Thu, 07 Sep 2017 08:18:27 GMT
* [test] rebase android jacoco test files


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

Branch: refs/heads/0.16-dev
Commit: 2cb1eb3db00f9a12c67f2580d33bb295b20a3788
Parents: 383f062
Author: atomtong <tong_huabing@qq.com>
Authored: Tue Sep 5 18:19:16 2017 +0800
Committer: atomtong <tong_huabing@qq.com>
Committed: Tue Sep 5 18:19:16 2017 +0800

----------------------------------------------------------------------
 android/build.gradle                            |  27 ++-------
 .../gradle/wrapper/gradle-wrapper.properties    |   3 +-
 android/playground/app/build.gradle             |  56 +------------------
 .../java/com/alibaba/weex/IndexActivity.java    |   6 +-
 .../java/com/alibaba/weex/WXPageActivity.java   |   4 --
 android/sdk/build.gradle                        |  14 +----
 android/sdk/coverage.ec                         | Bin 63 -> 0 bytes
 android/weex_debug/build.gradle                 |   2 +-
 8 files changed, 16 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2cb1eb3d/android/build.gradle
----------------------------------------------------------------------
diff --git a/android/build.gradle b/android/build.gradle
index b1297a9..28cf76e 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -2,14 +2,10 @@
 buildscript {
     repositories {
         mavenCentral()
-        maven {
-            url "http://mvnrepo.alibaba-inc.com/mvn/repository"
-        }
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.3.0'
-        classpath 'com.taobao.android.gradle:mtl-plugin:2.3.1.jacoco-SNAPSHOT'
+        classpath 'com.android.tools.build:gradle:2.1.3'
     }
 }
 
@@ -17,42 +13,31 @@ plugins {
     id "de.undercouch.download" version "3.2.0"
 }
 
-allprojects {
-    repositories {
+repositories {
         mavenCentral()
-        maven {
-            url "http://mvnrepo.alibaba-inc.com/mvn/repository"
-        }
         jcenter()
-    }
 }
 
 subprojects {
     repositories {
         mavenCentral()
-        maven {
-            url "http://mvnrepo.alibaba-inc.com/mvn/repository"
-        }
         jcenter()
     }
     buildscript {
         repositories {
             mavenCentral()
-            maven {
-                url "http://mvnrepo.alibaba-inc.com/mvn/repository"
-            }
             jcenter()
         }
         dependencies {
-            classpath 'com.android.tools.build:gradle:2.3.3'
+            classpath 'com.android.tools.build:gradle:2.1.3'
         }
     }
     ext {
         compileSdkVersion=25
         buildToolsVersion="25.0.3"
-        minSdkVersion=21
-        appMinSdkVersion=21
-        targetSdkVersion=21
+        minSdkVersion=14
+        appMinSdkVersion=15
+        targetSdkVersion=25
         supportLibVersion="25.3.1"
         fastjsonLibVersion="1.1.46.android"
     }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2cb1eb3d/android/gradle/wrapper/gradle-wrapper.properties
----------------------------------------------------------------------
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 34ba7a6..d795868 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -3,5 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
-
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2cb1eb3d/android/playground/app/build.gradle
----------------------------------------------------------------------
diff --git a/android/playground/app/build.gradle b/android/playground/app/build.gradle
index d023e84..bc50f70 100755
--- a/android/playground/app/build.gradle
+++ b/android/playground/app/build.gradle
@@ -1,11 +1,4 @@
 apply plugin: 'com.android.application'
-apply plugin: 'com.taobao.android.jacoco'
-apply plugin: "jacoco"
-
-jacoco {
-    toolVersion = "0.7.9"
-    reportsDir = file("$buildDir/customJacocoReportDir")
-}
 
 android {
     compileSdkVersion project.compileSdkVersion
@@ -42,15 +35,14 @@ android {
     }
     buildTypes {
         debug {
-            testCoverageEnabled true
+            testCoverageEnabled false
         }
     }
     sourceSets {
         main {
             jniLibs.srcDir(['libs'])
             java {
-//                srcDirs = ["src/main/java", "src/main/java_zxing"];
-                srcDirs = ['src/main/java']
+                srcDirs = ["src/main/java", "src/main/java_zxing"];
             }
         }
     }
@@ -114,48 +106,4 @@ dependencies {
     compile 'com.taobao.android.weex_inspection:urlconnection_interceptor:1.0.0'
     compile 'com.android.support.test.espresso:espresso-idling-resource:2.2.2'
     compile 'com.taobao.android:weex_inspector:0.11.0'
-}
-
-def coverageSourceDirs = ['../../../android/sdk/src/main/java']
-task jacocoTestReport(type: JacocoReport) {
-    group = "Reporting"
-    description = "Generate Jacoco coverage reports after running tests."
-    reports {
-        xml.enabled = true
-        html.enabled = true
-        csv.enabled true
-    }
-    classDirectories = fileTree(//"enter code here"
-            dir: '../../../android/sdk/build/intermediates/classes/debug',
-            excludes: ['**/R*.class',
-                       '**/*$InjectAdapter.class',
-                       '**/*$ViewInjector*.class',
-                       '**/*$BuildConfig.*',
-                       '**/R.class',
-                       '**/*$ViewInjector*.*',
-                       '**/*$ViewBinder*.*',
-                       '**/*MembersInjector*.*',
-                       '**/BuildConfig.*',
-                       '**/Manifest*.*',
-                       '**/*$Lambda$*.class',
-                       '**/*Factory*.class',
-                       '**/*$Builder*',
-                       '**/*DaggerApplicationComponent*.class',
-                       '**/api'
-            ])
-    sourceDirectories = files(coverageSourceDirs)
-    File configFile = file('../../../android/sdk/build/intermediates/classes/debug')
-
-    configFile = file(configFile.absolutePath)
-    println 'test==================='
-    println configFile.path
-
-    executionData = files("$buildDir/outputs/coverage.ec")
-    doFirst {
-        new File("../../../android/sdk/build/intermediates/classes/").eachFileRecurse { file
->
-            if (file.name.contains('$$')) {
-                file.renameTo(file.path.replace('$$', '$'))
-            }
-        }
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2cb1eb3d/android/playground/app/src/main/java/com/alibaba/weex/IndexActivity.java
----------------------------------------------------------------------
diff --git a/android/playground/app/src/main/java/com/alibaba/weex/IndexActivity.java b/android/playground/app/src/main/java/com/alibaba/weex/IndexActivity.java
index ab26512..866733a 100644
--- a/android/playground/app/src/main/java/com/alibaba/weex/IndexActivity.java
+++ b/android/playground/app/src/main/java/com/alibaba/weex/IndexActivity.java
@@ -40,7 +40,7 @@ import android.widget.TextView;
 import android.widget.Toast;
 
 import com.alibaba.weex.commons.AbstractWeexActivity;
-//import com.google.zxing.client.android.CaptureActivity;
+import com.google.zxing.client.android.CaptureActivity;
 import com.taobao.weex.WXRenderErrorCode;
 import com.taobao.weex.WXSDKEngine;
 import com.taobao.weex.WXSDKInstance;
@@ -145,7 +145,7 @@ public class IndexActivity extends AbstractWeexActivity {
             ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA},
CAMERA_PERMISSION_REQUEST_CODE);
           }
         } else {
-//          startActivity(new Intent(this, CaptureActivity.class));
+          startActivity(new Intent(this, CaptureActivity.class));
         }
         break;
       default:
@@ -159,7 +159,7 @@ public class IndexActivity extends AbstractWeexActivity {
   public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
{
     super.onRequestPermissionsResult(requestCode, permissions, grantResults);
     if (requestCode == CAMERA_PERMISSION_REQUEST_CODE && grantResults.length >
0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
-//      startActivity(new Intent(this, CaptureActivity.class));
+      startActivity(new Intent(this, CaptureActivity.class));
     } else if (requestCode == WRITE_EXTERNAL_STORAGE_PERMISSION_REQUEST_CODE && grantResults.length
> 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
     } else {
       Toast.makeText(this, "request camara permission fail!", Toast.LENGTH_SHORT).show();

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2cb1eb3d/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java
----------------------------------------------------------------------
diff --git a/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java b/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java
index e1a3b83..fe5994d 100644
--- a/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java
+++ b/android/playground/app/src/main/java/com/alibaba/weex/WXPageActivity.java
@@ -53,7 +53,6 @@ import com.alibaba.weex.https.HotRefreshManager;
 import com.alibaba.weex.https.WXHttpManager;
 import com.alibaba.weex.https.WXHttpTask;
 import com.alibaba.weex.https.WXRequestListener;
-import com.alibaba.weex.util.JacocoCodeCoverage;
 import com.taobao.weex.IWXRenderListener;
 import com.taobao.weex.RenderContainer;
 import com.taobao.weex.WXSDKEngine;
@@ -320,9 +319,6 @@ public class WXPageActivity extends WXBaseActivity implements IWXRenderListener,
   @Override
   protected void onDestroy() {
     super.onDestroy();
-	//jacoco code coverage
-//	JacocoCodeCoverage.dumpCodeCoverageByJacoco(getApplicationContext());
-
     if (mInstance != null) {
       mInstance.onActivityDestroy();
     }

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2cb1eb3d/android/sdk/build.gradle
----------------------------------------------------------------------
diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle
index 0f4e178..0be69fb 100755
--- a/android/sdk/build.gradle
+++ b/android/sdk/build.gradle
@@ -4,7 +4,7 @@ buildscript {
     }
 
     dependencies {
-//        classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.3'
+        classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.3'
         classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.5.0'
     }
 }
@@ -15,16 +15,9 @@ plugins {
 
 apply plugin: 'com.android.library'
 apply plugin: 'checkstyle'
-apply from: '../jacoco.gradle'
+apply plugin: 'com.getkeepsafe.dexcount'
 
-//apply plugin: 'com.getkeepsafe.dexcount'
-//apply plugin: 'jacoco'
-//
-//jacoco {
-//    toolVersion = "0.7.9+"
-//}
-
-ext.disableCov = project.hasProperty('disableCov') ? project.getProperty('disableCov') :
'true'
+ext.disableCov = project.hasProperty('disableCov') ? project.getProperty('disableCov') :
'false'
 if(!disableCov.toBoolean()){
     apply plugin: 'com.vanniktech.android.junit.jacoco'
     junitJacoco {
@@ -165,7 +158,6 @@ dependencies {
     testCompile 'org.robolectric:robolectric:3.3.2'
     testCompile "org.robolectric:shadows-httpclient:3.3.2"
     testCompile 'org.json:json:20160212'
-
 }
 if(file('../license/LICENSE').exists()){
     license {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2cb1eb3d/android/sdk/coverage.ec
----------------------------------------------------------------------
diff --git a/android/sdk/coverage.ec b/android/sdk/coverage.ec
deleted file mode 100644
index cc4c834..0000000
Binary files a/android/sdk/coverage.ec and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2cb1eb3d/android/weex_debug/build.gradle
----------------------------------------------------------------------
diff --git a/android/weex_debug/build.gradle b/android/weex_debug/build.gradle
index 2db7371..32b59ab 100644
--- a/android/weex_debug/build.gradle
+++ b/android/weex_debug/build.gradle
@@ -21,7 +21,7 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
         debug {
-            testCoverageEnabled false
+            testCoverageEnabled true
         }
     }
 }


Mime
View raw message