Xavier Ducrohet | 08517b6 | 2013-02-21 14:06:23 -0800 | [diff] [blame] | 1 | buildscript { |
| 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 Ducrohet | 34b3c47 | 2013-04-02 12:18:40 -0700 | [diff] [blame] | 10 | apply plugin: 'idea' |
Xavier Ducrohet | 08517b6 | 2013-02-21 14:06:23 -0800 | [diff] [blame] | 11 | apply plugin: 'clone-artifacts' |
| 12 | |
| 13 | // artifact cloning destinations |
| 14 | cloneArtifacts { |
| 15 | mainRepo = "$rootDir/../../prebuilts/tools/common/m2/repository" |
| 16 | secondaryRepo = "$rootDir/../../prebuilts/tools/common/m2/internal" |
| 17 | } |
Xavier Ducrohet | 34b3c47 | 2013-04-02 12:18:40 -0700 | [diff] [blame] | 18 | |
Raphael Moll | e8ecf47 | 2013-01-08 15:16:12 -0800 | [diff] [blame] | 19 | // ext.androidHostOut is shared by all tools/{base,build,swt} gradle projects/ |
Raphael Moll | 1ff0059 | 2013-02-12 10:13:12 -0800 | [diff] [blame] | 20 | ext.androidHostOut = file("$rootDir/../../out/host/gradle") |
| 21 | ext.androidRootDir = file(new File(ext.androidHostOut, "../../../")) |
Raphael Moll | e8ecf47 | 2013-01-08 15:16:12 -0800 | [diff] [blame] | 22 | // rootProject.buildDir is specific to this gradle build. |
| 23 | buildDir = new File(file(ext.androidHostOut), "tools/build/build") |
| 24 | |
Xavier Ducrohet | 08c2be1 | 2013-09-12 18:59:01 -0700 | [diff] [blame] | 25 | ext.localRepo = project.hasProperty('localRepo') ? localRepo : "$ext.androidHostOut/repo" |
| 26 | |
Xavier Ducrohet | 86fe655 | 2012-12-10 14:59:50 -0800 | [diff] [blame] | 27 | subprojects { |
Raphael Moll | e8ecf47 | 2013-01-08 15:16:12 -0800 | [diff] [blame] | 28 | // Change buildDir first so that all plugins pick up the new value. |
| 29 | project.buildDir = project.file("$project.parent.buildDir/../$project.name") |
| 30 | |
Xavier Ducrohet | 08a1fdb | 2012-08-28 19:09:17 -0700 | [diff] [blame] | 31 | apply plugin: 'idea' |
Xavier Ducrohet | 25879d3 | 2013-02-06 15:29:05 -0800 | [diff] [blame] | 32 | apply plugin: 'findbugs' |
Xavier Ducrohet | 08a1fdb | 2012-08-28 19:09:17 -0700 | [diff] [blame] | 33 | |
Xavier Ducrohet | 5415480 | 2012-08-30 15:41:10 -0700 | [diff] [blame] | 34 | repositories { |
Raphael Moll | e8ecf47 | 2013-01-08 15:16:12 -0800 | [diff] [blame] | 35 | maven { url = uri("$rootProject.ext.androidHostOut/repo") } |
Xavier Ducrohet | 5415480 | 2012-08-30 15:41:10 -0700 | [diff] [blame] | 36 | } |
| 37 | |
Xavier Ducrohet | 08517b6 | 2013-02-21 14:06:23 -0800 | [diff] [blame] | 38 | // 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 Ducrohet | 124edda | 2012-09-26 18:28:21 -0700 | [diff] [blame] | 48 | project.ext { |
Xavier Ducrohet | 301ed87 | 2013-11-14 11:23:45 -0800 | [diff] [blame] | 49 | baseVersion = '0.7.0' |
Xavier Ducrohet | 124edda | 2012-09-26 18:28:21 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Xavier Ducrohet | 82a108d | 2013-01-15 10:54:19 -0800 | [diff] [blame] | 52 | task disableTestFailures << { |
| 53 | tasks.withType(Test) { |
| 54 | ignoreFailures = true |
| 55 | } |
| 56 | } |
| 57 | |
Xavier Ducrohet | ecfdf72 | 2013-02-06 16:45:34 -0800 | [diff] [blame] | 58 | findbugs { |
Xavier Ducrohet | 25879d3 | 2013-02-06 15:29:05 -0800 | [diff] [blame] | 59 | ignoreFailures = true |
| 60 | effort = "max" |
| 61 | reportLevel = "high" |
| 62 | } |
| 63 | |
Xavier Ducrohet | 124edda | 2012-09-26 18:28:21 -0700 | [diff] [blame] | 64 | group = 'com.android.tools.build' |
Alex Ruiz | 5b51391 | 2013-11-03 22:27:26 +0000 | [diff] [blame] | 65 | project.ext.baseAndroidVersion = "22.2.0" |
Xavier Ducrohet | 4dab7c1 | 2013-05-14 23:25:08 -0700 | [diff] [blame] | 66 | if (!project.has("release")) { |
| 67 | project.ext.baseAndroidVersion = project.ext.baseAndroidVersion + "-SNAPSHOT" |
| 68 | } |
| 69 | |
Xavier Ducrohet | 08a1fdb | 2012-08-28 19:09:17 -0700 | [diff] [blame] | 70 | } |
Xavier Ducrohet | 7d37b2d | 2012-12-10 15:20:31 -0800 | [diff] [blame] | 71 | |
Xavier Ducrohet | 4b62230 | 2013-04-29 17:52:12 -0700 | [diff] [blame] | 72 | task prepareRepo(type: Copy) { |
| 73 | from { rootProject.cloneArtifacts.mainRepo } |
| 74 | from { rootProject.cloneArtifacts.secondaryRepo } |
| 75 | into { "$rootProject.ext.androidHostOut/repo" } |
| 76 | } |
| 77 | |
Xavier Ducrohet | 86fe655 | 2012-12-10 14:59:50 -0800 | [diff] [blame] | 78 | // delay evaluation of this project before all subprojects have been evaluated. |
| 79 | subprojects.each { subproject -> evaluationDependsOn(subproject.name) } |
| 80 | |
| 81 | def testTasks = subprojects.collect { it.tasks.withType(Test) }.flatten() |
| 82 | |
| 83 | task aggregateResults(type: Copy) { |
| 84 | from { testTasks*.testResultsDir } |
Raphael Moll | e8ecf47 | 2013-01-08 15:16:12 -0800 | [diff] [blame] | 85 | into { file("$buildDir/results") } |
Xavier Ducrohet | 7d37b2d | 2012-12-10 15:20:31 -0800 | [diff] [blame] | 86 | } |
Xavier Ducrohet | 71900c1 | 2012-12-20 16:34:59 -0800 | [diff] [blame] | 87 | |
| 88 | task clean(type: Delete) { |
Xavier Ducrohet | 3262b4c | 2013-01-14 18:10:04 -0800 | [diff] [blame] | 89 | delete '$buildDir' |
Raphael Moll | e8ecf47 | 2013-01-08 15:16:12 -0800 | [diff] [blame] | 90 | } |
| 91 | |