Home | History | Annotate | Download | only in canvasproof
      1 /*
      2  * Copyright 2015 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can be
      5  * found in the LICENSE file.
      6  */
      7 apply plugin: 'com.android.application'
      8 android {
      9     compileSdkVersion 19
     10     buildToolsVersion "22.0.1"
     11     defaultConfig {
     12         applicationId "org.skia.canvasproof"
     13         minSdkVersion 9
     14         targetSdkVersion 19
     15         versionCode 1
     16         versionName "1.0"
     17         signingConfig signingConfigs.debug
     18     }
     19     sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call
     20     sourceSets.main.jniLibs.srcDir "src/main/libs"
     21     productFlavors { arm {}; arm64 {}; x86 {}; x86_64 {}; mips {}; mips64 {}; }
     22     applicationVariants.all{ variant ->
     23         def buildNativeLib = task("${variant.name}_NativeLib", type:Exec) {
     24             workingDir '../../../..' // top-level skia directory
     25             commandLine constructBuildCommand(variant, "CopyCanvasProofDeps").split()
     26             environment PATH: getPathWithDepotTools()
     27             environment ANDROID_SDK_ROOT: getSDKPath()
     28         }
     29         buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") }
     30         TaskCollection<Task> assembleTask
     31         assembleTask = project.tasks.matching {
     32             it.name.contains("assemble") &&
     33                     it.name.toLowerCase().endsWith(variant.name.toLowerCase())
     34         }
     35         assembleTask.getAt(0).dependsOn buildNativeLib
     36     }
     37 }
     38