diff options
author | djsollen <djsollen@google.com> | 2015-07-22 11:33:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-22 11:33:25 -0700 |
commit | 425535f1626932e4e22f61a2571f9c3c2b1c5977 (patch) | |
tree | abea4aaaf77ea00c9f424ff8e003dffa9a4ce50f /platform_tools/android/apps/visualbench/build.gradle | |
parent | 404d9d620d98b186890f9dbdd3498557206c2793 (diff) |
Update Android Apps to use gradle
This CL replaces ant with gradle for the task of building APKs.
The primary driver of this change is that it now allow us to
develop and test our apps using Android Studio.
DOCS_PREVIEW= https://skia.org/?cl=1215023017
Review URL: https://codereview.chromium.org/1215023017
Diffstat (limited to 'platform_tools/android/apps/visualbench/build.gradle')
-rw-r--r-- | platform_tools/android/apps/visualbench/build.gradle | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/platform_tools/android/apps/visualbench/build.gradle b/platform_tools/android/apps/visualbench/build.gradle new file mode 100644 index 0000000000..81322b026e --- /dev/null +++ b/platform_tools/android/apps/visualbench/build.gradle @@ -0,0 +1,46 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 19 + buildToolsVersion "22.0.1" + + defaultConfig { + applicationId "com.skia.visualbench" + minSdkVersion 9 + targetSdkVersion 19 + versionCode 1 + versionName "1.0" + } + + sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call + sourceSets.main.jniLibs.srcDir "src/main/libs" + + productFlavors { + arm {} + arm64 {} + x86 {} + x86_64 {} + mips {} + mips64 {} + } + + // 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() + } + + if (!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 + } + } +}
\ No newline at end of file |