blob: b440c7fc3d8641c932b35a02100fa164bc6a9bd8 [file] [log] [blame]
Xavier Ducrohet08517b62013-02-21 14:06:23 -08001buildscript {
2 repositories {
3 maven { url "$rootDir/../../prebuilts/tools/common/gradle-plugins/repository" }
4 }
5 dependencies {
6 classpath 'com.android.tools.internal:internal-plugins:1.0'
7 }
8}
9
Xavier Ducrohet34b3c472013-04-02 12:18:40 -070010apply plugin: 'idea'
Xavier Ducrohet08517b62013-02-21 14:06:23 -080011apply plugin: 'clone-artifacts'
12
13// artifact cloning destinations
14cloneArtifacts {
15 mainRepo = "$rootDir/../../prebuilts/tools/common/m2/repository"
16 secondaryRepo = "$rootDir/../../prebuilts/tools/common/m2/internal"
17}
Xavier Ducrohet34b3c472013-04-02 12:18:40 -070018
Raphael Molle8ecf472013-01-08 15:16:12 -080019// ext.androidHostOut is shared by all tools/{base,build,swt} gradle projects/
Raphael Moll1ff00592013-02-12 10:13:12 -080020ext.androidHostOut = file("$rootDir/../../out/host/gradle")
21ext.androidRootDir = file(new File(ext.androidHostOut, "../../../"))
Raphael Molle8ecf472013-01-08 15:16:12 -080022// rootProject.buildDir is specific to this gradle build.
23buildDir = new File(file(ext.androidHostOut), "tools/build/build")
24
Xavier Ducrohet08c2be12013-09-12 18:59:01 -070025ext.localRepo = project.hasProperty('localRepo') ? localRepo : "$ext.androidHostOut/repo"
26
Xavier Ducrohet86fe6552012-12-10 14:59:50 -080027subprojects {
Raphael Molle8ecf472013-01-08 15:16:12 -080028 // Change buildDir first so that all plugins pick up the new value.
29 project.buildDir = project.file("$project.parent.buildDir/../$project.name")
30
Xavier Ducrohet08a1fdb2012-08-28 19:09:17 -070031 apply plugin: 'idea'
Xavier Ducrohet25879d32013-02-06 15:29:05 -080032 apply plugin: 'findbugs'
Xavier Ducrohet08a1fdb2012-08-28 19:09:17 -070033
Xavier Ducrohet54154802012-08-30 15:41:10 -070034 repositories {
Raphael Molle8ecf472013-01-08 15:16:12 -080035 maven { url = uri("$rootProject.ext.androidHostOut/repo") }
Xavier Ducrohet54154802012-08-30 15:41:10 -070036 }
37
Xavier Ducrohet08517b62013-02-21 14:06:23 -080038 // find bug dependencies is added dynamically so it's hard for the
39 // clone artifact plugin to find it. This custom config lets us manually
40 // add such dependencies.
41 configurations {
42 hidden
43 }
44 dependencies {
45 hidden "com.google.code.findbugs:findbugs:2.0.1"
46 }
47
Xavier Ducrohet124edda2012-09-26 18:28:21 -070048 project.ext {
Xavier Ducrohet301ed872013-11-14 11:23:45 -080049 baseVersion = '0.7.0'
Xavier Ducrohet124edda2012-09-26 18:28:21 -070050 }
51
Xavier Ducrohet82a108d2013-01-15 10:54:19 -080052 task disableTestFailures << {
53 tasks.withType(Test) {
54 ignoreFailures = true
55 }
56 }
57
Xavier Ducrohetecfdf722013-02-06 16:45:34 -080058 findbugs {
Xavier Ducrohet25879d32013-02-06 15:29:05 -080059 ignoreFailures = true
60 effort = "max"
61 reportLevel = "high"
62 }
63
Xavier Ducrohet124edda2012-09-26 18:28:21 -070064 group = 'com.android.tools.build'
Alex Ruiz5b513912013-11-03 22:27:26 +000065 project.ext.baseAndroidVersion = "22.2.0"
Xavier Ducrohet4dab7c12013-05-14 23:25:08 -070066 if (!project.has("release")) {
67 project.ext.baseAndroidVersion = project.ext.baseAndroidVersion + "-SNAPSHOT"
68 }
69
Xavier Ducrohet08a1fdb2012-08-28 19:09:17 -070070}
Xavier Ducrohet7d37b2d2012-12-10 15:20:31 -080071
Xavier Ducrohet4b622302013-04-29 17:52:12 -070072task prepareRepo(type: Copy) {
73 from { rootProject.cloneArtifacts.mainRepo }
74 from { rootProject.cloneArtifacts.secondaryRepo }
75 into { "$rootProject.ext.androidHostOut/repo" }
76}
77
Xavier Ducrohet86fe6552012-12-10 14:59:50 -080078// delay evaluation of this project before all subprojects have been evaluated.
79subprojects.each { subproject -> evaluationDependsOn(subproject.name) }
80
81def testTasks = subprojects.collect { it.tasks.withType(Test) }.flatten()
82
83task aggregateResults(type: Copy) {
84 from { testTasks*.testResultsDir }
Raphael Molle8ecf472013-01-08 15:16:12 -080085 into { file("$buildDir/results") }
Xavier Ducrohet7d37b2d2012-12-10 15:20:31 -080086}
Xavier Ducrohet71900c12012-12-20 16:34:59 -080087
88task clean(type: Delete) {
Xavier Ducrohet3262b4c2013-01-14 18:10:04 -080089 delete '$buildDir'
Raphael Molle8ecf472013-01-08 15:16:12 -080090}
91