blob: 56cdd5bb490e605afb8d91200d00a2b8e1243bd0 [file] [log] [blame]
jar {
from 'NOTICE'
from 'LICENSE'
}
project.ext.sonatypeUsername = hasProperty('sonatypeUsername') ? sonatypeUsername : ""
project.ext.sonatypePassword = hasProperty('sonatypePassword') ? sonatypePassword : ""
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment ->
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 project.ext.pomName
description project.ext.pomDesc
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/base'
connection 'git://android.googlesource.com/platform/tools/base.git'
}
developers {
developer {
name 'The Android Open Source Project'
}
}
}
}
}
}
// configure the publish local task with project specifics.
publishLocal {
repositories {
mavenDeployer {
pom.project {
name project.ext.pomName
description project.ext.pomDesc
}
}
}
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn:classes) {
duplicatesStrategy 'exclude' // To work around issuetracker.google.com/65217116
classifier = 'sources'
from sourceSets.main.allSource
from 'NOTICE'
from 'LICENSE'
}
// add source jar tasks as artifacts
artifacts {
archives jar
archives sourcesJar
}
task uploadlLocal(type: Upload) {
configuration = configurations.archives
repositories {
mavenDeployer {
repository(url: uri("$rootProject.ext.localRepo"))
}
}
}