Upgrade Android Gradle plugins
authordjsollen <djsollen@google.com>
Wed, 27 Apr 2016 15:48:56 +0000 (08:48 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 27 Apr 2016 15:48:56 +0000 (08:48 -0700)
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1926743002

Review-Url: https://codereview.chromium.org/1926743002

platform_tools/android/apps/build.gradle
platform_tools/android/apps/canvasproof/build.gradle
platform_tools/android/apps/gradle/wrapper/gradle-wrapper.properties
platform_tools/android/apps/sample_app/build.gradle
platform_tools/android/apps/visualbench/build.gradle
platform_tools/android/apps/visualbenchsdl/build.gradle
platform_tools/android/apps/vulkanviewer/build.gradle
platform_tools/android/gyp/skia_android.gypi
platform_tools/android/gyp/vulkanviewer.gypi

index b20334b..7622cbd 100644 (file)
@@ -1,11 +1,12 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 
+
 buildscript {
     repositories {
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.2.3'
+        classpath 'com.android.tools.build:gradle:2.1.0'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
@@ -18,6 +19,24 @@ allprojects {
     }
 }
 
+def setupSkiaLibraryBuild(project, appVariants, buildCmd) {
+    appVariants.all{ variant ->
+        def buildNativeLib = project.task("${variant.name}_SkiaNativeLib", type:Exec) {
+            workingDir '../../../..' // top-level skia directory
+            commandLine constructBuildCommand(variant, buildCmd).split()
+            environment PATH: getPathWithDepotTools()
+            environment ANDROID_SDK_ROOT: getSDKPath()
+        }
+        buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
+        TaskCollection<Task> compileTask = project.tasks.matching {
+            //  println(it.name)
+            it.name.toLowerCase().contains("compile" + variant.name.toLowerCase()) &&
+                    it.name.toLowerCase().endsWith("ndk")
+        }
+        compileTask.getAt(0).dependsOn buildNativeLib
+    }
+}
+
 def getLocalProperties() {
     Properties properties = new Properties()
     File propFile = project.rootProject.file('local.properties')
index 64463e8..5493699 100644 (file)
@@ -19,19 +19,5 @@ android {
     sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call
     sourceSets.main.jniLibs.srcDir "src/main/libs"
     productFlavors { arm {}; arm64 {}; x86 {}; x86_64 {}; mips {}; mips64 {}; }
-    applicationVariants.all{ variant ->
-        def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) {
-            workingDir '../../../..' // top-level skia directory
-            commandLine constructBuildCommand(variant, "CopyCanvasProofDeps").split()
-            environment PATH: getPathWithDepotTools()
-            environment ANDROID_SDK_ROOT: getSDKPath()
-        }
-        buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
-        TaskCollection<Task> assembleTask
-        assembleTask = project.tasks.matching {
-            it.name.contains("assemble") &&
-                    it.name.toLowerCase().endsWith(variant.name.toLowerCase())
-        }
-        assembleTask.getAt(0).dependsOn buildNativeLib
-    }
+    setupSkiaLibraryBuild(project, applicationVariants, "CopyCanvasProofDeps")
 }
index a7eb58a..be9e31c 100644 (file)
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
index def446a..4678980 100644 (file)
@@ -26,22 +26,5 @@ android {
     }
 
     // make sure that app is built and shared libraries are copied to correct directories
-    applicationVariants.all{ variant ->
-
-        def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) {
-            workingDir '../../../..' // top-level skia directory
-            commandLine constructBuildCommand(variant, "CopySampleAppDeps").split()
-            environment PATH: getPathWithDepotTools()
-            environment ANDROID_SDK_ROOT: getSDKPath()
-        }
-
-        buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
-
-        TaskCollection<Task> assembleTask
-        assembleTask = project.tasks.matching {
-            it.name.contains("assemble") &&
-                    it.name.toLowerCase().endsWith(variant.name.toLowerCase())
-        }
-        assembleTask.getAt(0).dependsOn buildNativeLib
-    }
+    setupSkiaLibraryBuild(project, applicationVariants, "CopySampleAppDeps")
 }
\ No newline at end of file
index a7b78fb..e64e43e 100644 (file)
@@ -26,22 +26,5 @@ android {
     }
 
     // make sure that app is built and shared libraries are copied to correct directories
-    applicationVariants.all{ variant ->
-
-        def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) {
-            workingDir '../../../..' // top-level skia directory
-            commandLine constructBuildCommand(variant, "CopyVisualBenchDeps").split()
-            environment PATH: getPathWithDepotTools()
-            environment ANDROID_SDK_ROOT: getSDKPath()
-        }
-
-        buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
-
-        TaskCollection<Task> assembleTask
-        assembleTask = project.tasks.matching {
-            it.name.contains("assemble") &&
-                    it.name.toLowerCase().endsWith(variant.name.toLowerCase())
-        }
-        assembleTask.getAt(0).dependsOn buildNativeLib
-    }
+    setupSkiaLibraryBuild(project, applicationVariants, "CopyVisualBenchDeps")
 }
index a7b78fb..e64e43e 100644 (file)
@@ -26,22 +26,5 @@ android {
     }
 
     // make sure that app is built and shared libraries are copied to correct directories
-    applicationVariants.all{ variant ->
-
-        def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) {
-            workingDir '../../../..' // top-level skia directory
-            commandLine constructBuildCommand(variant, "CopyVisualBenchDeps").split()
-            environment PATH: getPathWithDepotTools()
-            environment ANDROID_SDK_ROOT: getSDKPath()
-        }
-
-        buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
-
-        TaskCollection<Task> assembleTask
-        assembleTask = project.tasks.matching {
-            it.name.contains("assemble") &&
-                    it.name.toLowerCase().endsWith(variant.name.toLowerCase())
-        }
-        assembleTask.getAt(0).dependsOn buildNativeLib
-    }
+    setupSkiaLibraryBuild(project, applicationVariants, "CopyVisualBenchDeps")
 }
index acb6740..d8825c5 100644 (file)
@@ -10,7 +10,7 @@ android {
     buildToolsVersion "22.0.1"
     defaultConfig {
         applicationId "org.skia.vulkanviewer"
-        minSdkVersion 9
+        minSdkVersion 19
         targetSdkVersion 19
         versionCode 1
         versionName "1.0"
@@ -19,19 +19,6 @@ android {
     sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call
     sourceSets.main.jniLibs.srcDir "src/main/libs"
     productFlavors { arm {}; arm64 {}; x86 {}; x86_64 {}; mips {}; mips64 {}; }
-    applicationVariants.all{ variant ->
-        def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) {
-            workingDir '../../../..' // top-level skia directory
-            commandLine constructBuildCommand(variant, "CopyVulkanViewerDeps").split()
-            environment PATH: getPathWithDepotTools()
-            environment ANDROID_SDK_ROOT: getSDKPath()
-        }
-        buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
-        TaskCollection<Task> assembleTask
-        assembleTask = project.tasks.matching {
-            it.name.contains("assemble") &&
-                    it.name.toLowerCase().endsWith(variant.name.toLowerCase())
-        }
-        assembleTask.getAt(0).dependsOn buildNativeLib
-    }
+
+    setupSkiaLibraryBuild(project, applicationVariants, "--vulkan CopyVulkanViewerDeps")
 }
index 7767183..29342d9 100644 (file)
         'android_arch%': "mips64",
         'android_variant%': "mips64",
       }],
-      [ 'android_buildtype == "Release"', {
-        'android_apk_suffix': "release.apk",
-      }, {
+      [ 'android_buildtype == "Debug"', {
         'android_apk_suffix': "debug.apk",
+      }, {
+        # This also accounts for Release_Developer BUILDTYPE
+        'android_buildtype': "Release", 
+        'android_apk_suffix': "release.apk",
       }],
     ],
   },
index adcfd22..b431e84 100644 (file)
@@ -53,7 +53,7 @@
           ],
           'action': [
             '<(android_base)/apps/gradlew',
-            ':vulkanviewer:assemble<(android_variant)Debug',
+            ':vulkanviewer:assemble<(android_variant)<(android_buildtype)',
             '-p<(android_base)/apps/vulkanviewer',
             '-PsuppressNativeBuild',
             '--daemon',