3 apply plugin: 'signing'
7 compile.extendsFrom gradleApi
8 gradleApi.extendsFrom groovy
13 groovy.srcDir file('src/build-test/groovy')
14 resources.srcDir file('src/build-test/resources')
17 groovy.srcDir file('src/device-test/groovy')
18 resources.srcDir file('src/device-test/resources')
25 compile project(':builder')
27 testCompile 'junit:junit:3.8.1'
29 buildTestCompile sourceSets.main.output
30 buildTestCompile configurations.testCompile
31 buildTestCompile sourceSets.test.output
32 buildTestCompile configurations.testRuntime
34 deviceTestCompile sourceSets.main.output
35 deviceTestCompile configurations.testCompile
36 deviceTestCompile sourceSets.test.output
37 deviceTestCompile configurations.testRuntime
42 testSourceDirs += files('src/build-test/groovy', 'src/device-test/groovy').files
47 if (project.has("release")) {
48 return project.ext.baseVersion
51 return project.ext.baseVersion + '-SNAPSHOT'
54 version = getVersion()
55 archivesBaseName = 'gradle'
57 task publishLocal(type: Upload) {
58 configuration = configurations.archives
61 repository(url: uri("$rootDir/repo"))
65 publishLocal.dependsOn ':builder:publishLocal'
67 task buildTest(type: Test, dependsOn: publishLocal) {
68 testClassesDir = sourceSets.buildTest.output.classesDir
69 classpath = sourceSets.buildTest.runtimeClasspath
70 description = "Runs the project build tests. This requires an SDK either from the Android source tree, under out/..., or an env var ANDROID_HOME."
71 group = "verification"
72 systemProperties['jar.path'] = jar.archivePath
75 task deviceTest(dependsOn: publishLocal) {
76 testClassesDir = sourceSets.deviceTest.output.classesDir
77 classpath = sourceSets.deviceTest.runtimeClasspath
78 description = "Runs the device tests. This requires a device."
79 group = "verification"
80 //systemProperties['jar.path'] = jar.archivePath
83 deviceTest.dependsOn buildTest
84 check.dependsOn buildTest
85 // uncomment when device tests are ready.
86 //check.dependsOn deviceTest
89 project.ext.sonatypeUsername = project.hasProperty('sonatypeUsername') ? sonatypeUsername : ""
90 project.ext.sonatypePassword = project.hasProperty('sonatypePassword') ? sonatypePassword : ""
95 beforeDeployment { MavenDeployment deployment ->
96 if (!project.has("release")) {
97 throw new StopExecutionException("uploadArchives must be called with the release.gradle init script")
100 if (project.ext.sonatypeUsername.length() == 0 || project.ext.sonatypePassword.length() == 0) {
101 throw new StopExecutionException("uploadArchives cannot be called without sonatype username and password")
104 signing.signPom(deployment)
107 repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
108 authentication(userName: project.ext.sonatypeUsername, password: project.ext.sonatypePassword)
112 name 'Gradle Plug-in for Android'
113 description 'Gradle plug-in to build Android applications.'
114 url 'http://tools.android.com'
119 name 'The Apache Software License, Version 2.0'
120 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
126 url "https://android.googlesource.com/platform/tools/build"
127 connection "git://android.googlesource.com/platform/tools/build.git"
132 name 'The Android Open Source Project'
140 // custom tasks for creating source/javadoc jars
141 task sourcesJar(type: Jar, dependsOn:classes) {
142 classifier = 'sources'
143 from sourceSets.main.allSource
147 exclude "**/internal/**"
150 docTitle "Gradle Plugin for Android"
152 footer "Copyright (C) 2012 The Android Open Source Project"
156 task javadocJar(type: Jar, dependsOn:groovydoc) {
158 from groovydoc.destinationDir
161 // add javadoc/source jar tasks as artifacts
169 required { project.has("release") && gradle.taskGraph.hasTask("uploadArchives") }
170 sign configurations.archives