1apply plugin: 'java' 2 3repositories { 4 maven { url '../../../prebuilts/tools/common/m2/repository' } 5 maven { url '../../../prebuilts/gradle-plugin'} 6} 7 8/* 9 * With the build server you are given two env variables. 10 * The OUT_DIR is a temporary directory you can use to put things during the build. 11 * The DIST_DIR is where you want to save things from the build. 12 * 13 * The build server will copy the contents of DIST_DIR to somewhere and make it available. 14 */ 15if (System.env.DIST_DIR != null && System.env.OUT_DIR != null) { 16 buildDir = new File(System.env.OUT_DIR + '/gradle/checkcolor').getCanonicalFile() 17 project.ext.distDir = new File(System.env.DIST_DIR).getCanonicalFile() 18 19 // the build server does not pass the build number so we infer it from the last folder of the dist path. 20 ext.buildNumber = project.ext.distDir.getName() 21} else { 22 buildDir = file("${project.rootDir}/../../../out/host/gradle/checkcolor") 23 project.ext.distDir = file("${project.rootDir}/../../../out/dist") 24} 25 26sourceCompatibility = 1.8 27 28dependencies { 29 compile 'com.android.tools.lint:lint-api:24.3.1' 30 compile 'com.android.tools.lint:lint-checks:24.3.1' 31 testCompile 'junit:junit:4.11' 32 testCompile 'com.android.tools.lint:lint:24.3.1' 33 testCompile 'com.android.tools.lint:lint-tests:24.3.1' 34 testCompile 'com.android.tools:testutils:24.3.1' 35} 36 37jar { 38 destinationDir project.ext.distDir 39 40 manifest { 41 attributes("Lint-Registry": "com.google.checkcolor.lint.HardcodedColorIssueRegistry") 42 } 43} 44 45defaultTasks 'assemble' 46