| buildscript { |
| repositories { |
| maven { url "$rootDir/../../prebuilts/tools/common/gradle-plugins/repository" } |
| } |
| dependencies { |
| classpath 'com.android.tools.internal:internal-plugins:1.1' |
| } |
| } |
| |
| apply plugin: 'clone-artifacts' |
| apply plugin: 'distrib' |
| |
| // artifact cloning destinations |
| cloneArtifacts { |
| mainRepo = "$rootDir/../../prebuilts/tools/common/m2/repository" |
| secondaryRepo = "$rootDir/../../prebuilts/tools/common/m2/internal" |
| } |
| // set up the distribution destination |
| distribution { |
| destinationPath = "$rootDir/../../prebuilts/devtools" |
| dependenciesRepo = cloneArtifacts.mainRepo |
| } |
| |
| // ext.androidHostOut is shared by all tools/{base,build,swt} gradle projects/ |
| ext.androidHostOut = file("$rootDir/../../out/host/gradle") |
| ext.androidRootDir = file(new File(ext.androidHostOut, "../../../")) |
| // rootProject.buildDir is specific to this gradle build. |
| buildDir = new File(file(ext.androidHostOut), "tools/swt/build") |
| |
| def getVersion(Project p, String baseVersion) { |
| if (p.has("release")) { |
| return baseVersion |
| } |
| |
| return baseVersion + '-SNAPSHOT' |
| } |
| |
| subprojects { Project project -> |
| // Change buildDir first so that all plugins pick up the new value. |
| project.buildDir = project.file("$project.parent.buildDir/../$project.name") |
| |
| apply plugin: 'java' |
| apply plugin: 'maven' |
| apply plugin: 'findbugs' |
| apply plugin: 'distrib' |
| apply plugin: 'clone-artifacts' |
| |
| repositories { |
| maven { url = uri(rootProject.cloneArtifacts.mainRepo) } |
| maven { url = uri(rootProject.cloneArtifacts.secondaryRepo) } |
| maven { url = uri("$rootProject.ext.androidHostOut/repo") } |
| } |
| |
| // find bug dependencies is added dynamically so it's hard for the |
| // clone artifact plugin to find it. This custom config lets us manually |
| // add such dependencies. |
| configurations { |
| hidden |
| } |
| dependencies { |
| hidden "com.google.code.findbugs:findbugs:2.0.1" |
| } |
| |
| // configuration for swt dependency since the packaged jar is platform dependent |
| // but at compile time we don't care. Also we don't want the artifact in the |
| // main repo, so use the provided configuration |
| configurations { |
| swt |
| } |
| |
| dependencies{ |
| swt "com.android.external.eclipse:swt:3.5.0" |
| compile 'com.android.external.eclipse:org-eclipse-jface:3.6.2' |
| testCompile "com.android.external.eclipse:swt:3.5.0" |
| } |
| |
| // include swt for compilation |
| sourceSets.main.compileClasspath += configurations.swt |
| |
| ext.baseVersion = '22.7.3' |
| |
| version = getVersion(project, ext.baseVersion) |
| |
| // set all java compilation to use UTF-8 encoding. |
| tasks.withType(JavaCompile) { |
| options.encoding = 'UTF-8' |
| } |
| |
| task disableTestFailures << { |
| tasks.withType(Test) { |
| ignoreFailures = true |
| } |
| } |
| |
| // add javadoc/source jar tasks as artifacts |
| artifacts { |
| archives jar |
| } |
| |
| task publishLocal(type: Upload) { |
| configuration = configurations.archives |
| repositories { |
| mavenDeployer { |
| repository(url: uri("$rootProject.ext.androidHostOut/repo")) |
| } |
| } |
| } |
| |
| findbugs { |
| ignoreFailures = true |
| effort = "max" |
| reportLevel = "high" |
| } |
| |
| } |
| |
| // delay evaluation of this project before all subprojects have been evaluated. |
| subprojects.each { subproject -> evaluationDependsOn(subproject.path) } |
| |
| def testTasks = subprojects.collect { it.tasks.withType(Test) }.flatten() |
| |
| task aggregateResults(type: Copy) { |
| from { testTasks*.testResultsDir } |
| into { file("$buildDir/results") } |
| } |