blob: 5197b98fbd93f420f89576ac0400b9527fa47a3a [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 Ducrohet86fe6552012-12-10 14:59:50 -080025subprojects {
Raphael Molle8ecf472013-01-08 15:16:12 -080026 // Change buildDir first so that all plugins pick up the new value.
27 project.buildDir = project.file("$project.parent.buildDir/../$project.name")
28
Xavier Ducrohet08a1fdb2012-08-28 19:09:17 -070029 apply plugin: 'idea'
Xavier Ducrohet25879d32013-02-06 15:29:05 -080030 apply plugin: 'findbugs'
Xavier Ducrohet08a1fdb2012-08-28 19:09:17 -070031
Xavier Ducrohet54154802012-08-30 15:41:10 -070032 repositories {
Xavier Ducrohet08517b62013-02-21 14:06:23 -080033 // repository containing the cloned 3rd party artifacts.
34 maven { url = uri(rootProject.cloneArtifacts.mainRepo) }
35 maven { url = uri(rootProject.cloneArtifacts.secondaryRepo) }
36
37 // repository with the artifacts from tools/base
Raphael Molle8ecf472013-01-08 15:16:12 -080038 maven { url = uri("$rootProject.ext.androidHostOut/repo") }
Xavier Ducrohet54154802012-08-30 15:41:10 -070039 }
40
Xavier Ducrohet08517b62013-02-21 14:06:23 -080041 // find bug dependencies is added dynamically so it's hard for the
42 // clone artifact plugin to find it. This custom config lets us manually
43 // add such dependencies.
44 configurations {
45 hidden
46 }
47 dependencies {
48 hidden "com.google.code.findbugs:findbugs:2.0.1"
49 }
50
Xavier Ducrohet124edda2012-09-26 18:28:21 -070051 project.ext {
Xavier Ducrohet1918f7b2013-02-26 11:57:02 -080052 baseVersion = '0.4'
Xavier Ducrohet124edda2012-09-26 18:28:21 -070053 }
54
Xavier Ducrohet82a108d2013-01-15 10:54:19 -080055 task disableTestFailures << {
56 tasks.withType(Test) {
57 ignoreFailures = true
58 }
59 }
60
Xavier Ducrohetecfdf722013-02-06 16:45:34 -080061 findbugs {
Xavier Ducrohet25879d32013-02-06 15:29:05 -080062 ignoreFailures = true
63 effort = "max"
64 reportLevel = "high"
65 }
66
Xavier Ducrohet124edda2012-09-26 18:28:21 -070067 group = 'com.android.tools.build'
Xavier Ducrohet5894d6b2013-03-27 08:51:14 -070068 project.ext.baseAndroidVersion = "22.0-SNAPSHOT"
Xavier Ducrohet08a1fdb2012-08-28 19:09:17 -070069}
Xavier Ducrohet7d37b2d2012-12-10 15:20:31 -080070
Xavier Ducrohet86fe6552012-12-10 14:59:50 -080071// delay evaluation of this project before all subprojects have been evaluated.
72subprojects.each { subproject -> evaluationDependsOn(subproject.name) }
73
74def testTasks = subprojects.collect { it.tasks.withType(Test) }.flatten()
75
76task aggregateResults(type: Copy) {
77 from { testTasks*.testResultsDir }
Raphael Molle8ecf472013-01-08 15:16:12 -080078 into { file("$buildDir/results") }
Xavier Ducrohet7d37b2d2012-12-10 15:20:31 -080079}
Xavier Ducrohet71900c12012-12-20 16:34:59 -080080
81task clean(type: Delete) {
Xavier Ducrohet3262b4c2013-01-14 18:10:04 -080082 delete '$buildDir'
Raphael Molle8ecf472013-01-08 15:16:12 -080083}
84