task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
task androidJavadocs(type: Javadoc) {
failOnError false
source = project.android.sourceSets.main.java.srcDirs
classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
uploadArchives {
repositories.mavenDeployer {
repository(url: uri('../repository'))
// 唯一标识
pom.groupId = groupId
// 项目名称
pom.artifactId = artifactId
// 版本号
pom.version = version
}
}