Upgrade Android Gradle plugins
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
This commit is contained in:
parent
1e7f5e708e
commit
f62b2354b3
@ -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')
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
}
|
@ -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")
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -38,10 +38,12 @@
|
||||
'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",
|
||||
}],
|
||||
],
|
||||
},
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user