Fix tests running on the server.
[android/platform/tools/build.git] / build.gradle
1 // ext.androidHostOut is shared by all tools/{base,build,swt} gradle projects/
2 ext.androidHostOut = java.lang.System.getenv("ANDROID_HOST_OUT")
3 if (ext.androidHostOut == null) {
4   ext.androidHostOut = "$rootDir/../../out/host/common"
5 }
6 // rootProject.buildDir is specific to this gradle build.
7 buildDir = new File(file(ext.androidHostOut), "tools/build/build")
8
9 subprojects {
10     // Change buildDir first so that all plugins pick up the new value.
11     project.buildDir = project.file("$project.parent.buildDir/../$project.name")
12
13     apply plugin: 'idea'
14     apply plugin: 'findbugs'
15
16     repositories {
17         mavenCentral()
18         maven { url = uri("$rootProject.ext.androidHostOut/repo") }
19     }
20
21     project.ext {
22         baseVersion = '0.3'
23     }
24
25     task disableTestFailures << {
26         tasks.withType(Test) {
27             ignoreFailures = true
28         }
29     }
30
31     findbugs {
32         ignoreFailures = true
33         effort = "max"
34         reportLevel = "high"
35     }
36
37     group = 'com.android.tools.build'
38 }
39
40 // delay evaluation of this project before all subprojects have been evaluated.
41 subprojects.each { subproject -> evaluationDependsOn(subproject.name) }
42
43 def testTasks = subprojects.collect { it.tasks.withType(Test) }.flatten()
44
45 task aggregateResults(type: Copy) {
46     from { testTasks*.testResultsDir }
47     into { file("$buildDir/results") }
48 }
49
50 task clean(type: Delete) {
51    delete '$buildDir'
52 }
53