djsollen 2016-04-27 08:48:56 -07:00 committed by Commit bot
parent 1e7f5e708e
commit f62b2354b3
9 changed files with 34 additions and 91 deletions

View 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')

View 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")
}

View 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

View 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")
}

View 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")
}

View 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")
}

View 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")
}

View File

@ -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",
}],
],
},

View 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',