OLD | NEW |
1 // Top-level build file where you can add configuration options common to all su
b-projects/modules. | 1 // Top-level build file where you can add configuration options common to all su
b-projects/modules. |
2 | 2 |
| 3 |
3 buildscript { | 4 buildscript { |
4 repositories { | 5 repositories { |
5 jcenter() | 6 jcenter() |
6 } | 7 } |
7 dependencies { | 8 dependencies { |
8 classpath 'com.android.tools.build:gradle:1.2.3' | 9 classpath 'com.android.tools.build:gradle:2.1.0' |
9 | 10 |
10 // NOTE: Do not place your application dependencies here; they belong | 11 // NOTE: Do not place your application dependencies here; they belong |
11 // in the individual module build.gradle files | 12 // in the individual module build.gradle files |
12 } | 13 } |
13 } | 14 } |
14 | 15 |
15 allprojects { | 16 allprojects { |
16 repositories { | 17 repositories { |
17 jcenter() | 18 jcenter() |
18 } | 19 } |
19 } | 20 } |
20 | 21 |
| 22 def setupSkiaLibraryBuild(project, appVariants, buildCmd) { |
| 23 appVariants.all{ variant -> |
| 24 def buildNativeLib = project.task("${variant.name}_SkiaNativeLib", type:
Exec) { |
| 25 workingDir '../../../..' // top-level skia directory |
| 26 commandLine constructBuildCommand(variant, buildCmd).split() |
| 27 environment PATH: getPathWithDepotTools() |
| 28 environment ANDROID_SDK_ROOT: getSDKPath() |
| 29 } |
| 30 buildNativeLib.onlyIf { !project.hasProperty("suppressNativeBuild") } |
| 31 TaskCollection<Task> compileTask = project.tasks.matching { |
| 32 // println(it.name) |
| 33 it.name.toLowerCase().contains("compile" + variant.name.toLowerCase(
)) && |
| 34 it.name.toLowerCase().endsWith("ndk") |
| 35 } |
| 36 compileTask.getAt(0).dependsOn buildNativeLib |
| 37 } |
| 38 } |
| 39 |
21 def getLocalProperties() { | 40 def getLocalProperties() { |
22 Properties properties = new Properties() | 41 Properties properties = new Properties() |
23 File propFile = project.rootProject.file('local.properties') | 42 File propFile = project.rootProject.file('local.properties') |
24 if (propFile.canRead()) { | 43 if (propFile.canRead()) { |
25 properties.load(propFile.newDataInputStream()) | 44 properties.load(propFile.newDataInputStream()) |
26 } | 45 } |
27 propFile = project.rootProject.file('gradle.properties') | 46 propFile = project.rootProject.file('gradle.properties') |
28 if (propFile.canRead()) { | 47 if (propFile.canRead()) { |
29 properties.load(propFile.newDataInputStream()) | 48 properties.load(propFile.newDataInputStream()) |
30 } | 49 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 96 |
78 if (deviceType != null) { | 97 if (deviceType != null) { |
79 cmdLine += " -d " + deviceType | 98 cmdLine += " -d " + deviceType |
80 } | 99 } |
81 | 100 |
82 if (variant.name.endsWith("Release")) { | 101 if (variant.name.endsWith("Release")) { |
83 cmdLine += " --release" | 102 cmdLine += " --release" |
84 } | 103 } |
85 return cmdLine | 104 return cmdLine |
86 } | 105 } |
OLD | NEW |