| OLD | NEW |
| 1 apply plugin: 'com.android.application' | 1 apply plugin: 'com.android.application' |
| 2 | 2 |
| 3 android { | 3 android { |
| 4 compileSdkVersion 19 | 4 compileSdkVersion 19 |
| 5 buildToolsVersion "22.0.1" | 5 buildToolsVersion "22.0.1" |
| 6 | 6 |
| 7 defaultConfig { | 7 defaultConfig { |
| 8 applicationId "com.skia.sample_app" | 8 applicationId "com.skia.sample_app" |
| 9 minSdkVersion 9 | 9 minSdkVersion 9 |
| 10 targetSdkVersion 19 | 10 targetSdkVersion 19 |
| 11 versionCode 1 | 11 versionCode 1 |
| 12 versionName "1.0" | 12 versionName "1.0" |
| 13 signingConfig signingConfigs.debug | 13 signingConfig signingConfigs.debug |
| 14 } | 14 } |
| 15 | 15 |
| 16 sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call | 16 sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call |
| 17 sourceSets.main.jniLibs.srcDir "src/main/libs" | 17 sourceSets.main.jniLibs.srcDir "src/main/libs" |
| 18 | 18 |
| 19 productFlavors { | 19 productFlavors { |
| 20 arm {} | 20 arm {} |
| 21 arm64 {} | 21 arm64 {} |
| 22 x86 {} | 22 x86 {} |
| 23 x86_64 {} | 23 x86_64 {} |
| 24 mips {} | 24 mips {} |
| 25 mips64 {} | 25 mips64 {} |
| 26 } | 26 } |
| 27 | 27 |
| 28 // make sure that app is built and shared libraries are copied to correct di
rectories | 28 // make sure that app is built and shared libraries are copied to correct di
rectories |
| 29 applicationVariants.all{ variant -> | 29 setupSkiaLibraryBuild(project, applicationVariants, "CopySampleAppDeps") |
| 30 | |
| 31 def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) { | |
| 32 workingDir '../../../..' // top-level skia directory | |
| 33 commandLine constructBuildCommand(variant, "CopySampleAppDeps").spli
t() | |
| 34 environment PATH: getPathWithDepotTools() | |
| 35 environment ANDROID_SDK_ROOT: getSDKPath() | |
| 36 } | |
| 37 | |
| 38 buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") } | |
| 39 | |
| 40 TaskCollection<Task> assembleTask | |
| 41 assembleTask = project.tasks.matching { | |
| 42 it.name.contains("assemble") && | |
| 43 it.name.toLowerCase().endsWith(variant.name.toLowerCase()) | |
| 44 } | |
| 45 assembleTask.getAt(0).dependsOn buildNativeLib | |
| 46 } | |
| 47 } | 30 } |
| OLD | NEW |