diff options
author | Xavier Ducrohet <xav@google.com> | 2013-05-14 23:25:08 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2013-05-15 07:03:05 +0000 |
commit | 4dab7c11b9123e16fb1637adaa08cd7585754946 (patch) | |
tree | 34124943d28bc997cbe7d44e045f5acae913a676 /gradle-model | |
parent | e411417577feefe95e32c8a690a8d0fedf3c152d (diff) | |
download | build-4dab7c11b9123e16fb1637adaa08cd7585754946.tar.gz |
Add missing uploadArchives task for new modules.
Change-Id: Ie1f7b1112b3c73087b879917c5a594d27ccbee39
(cherry picked from commit a6325adf5c3b6c2e160111396c1967e9bc3ee27b)
Diffstat (limited to 'gradle-model')
-rw-r--r-- | gradle-model/build.gradle | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gradle-model/build.gradle b/gradle-model/build.gradle index 724bab4..e6d006b 100644 --- a/gradle-model/build.gradle +++ b/gradle-model/build.gradle @@ -53,6 +53,56 @@ task publishLocal(type: Upload) { } } +project.ext.sonatypeUsername = hasProperty('sonatypeUsername') ? sonatypeUsername : "" +project.ext.sonatypePassword = hasProperty('sonatypePassword') ? sonatypePassword : "" + +uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> + if (!project.has("release")) { + throw new StopExecutionException("uploadArchives must be called with the release.gradle init script") + } + + if (project.ext.sonatypeUsername.length() == 0 || project.ext.sonatypePassword.length() == 0) { + throw new StopExecutionException("uploadArchives cannot be called without sonatype username and password") + } + + signing.signPom(deployment) + } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: project.ext.sonatypeUsername, password: project.ext.sonatypePassword) + } + + pom.project { + name 'Android Gradle Model' + description 'Model for the Android Gradle plugin.' + url 'http://tools.android.com' + inceptionYear '2007' + + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + + scm { + url "https://android.googlesource.com/platform/tools/build" + connection "git://android.googlesource.com/platform/tools/build.git" + } + developers { + developer { + name 'The Android Open Source Project' + } + } + } + } + } +} + // custom tasks for creating source/javadoc jars task sourcesJar(type: Jar, dependsOn:classes) { classifier = 'sources' @@ -77,3 +127,8 @@ artifacts { archives sourcesJar archives javadocJar } + +signing { + required { project.has("release") && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives +} |