Refactor the maven upload build stuff

This also adds the required javadoc jars
This commit is contained in:
Ben Gruver
2014-01-18 11:33:39 -08:00
parent 0845df7dd0
commit 1d28b32ff5
6 changed files with 60 additions and 78 deletions

View File

@ -80,15 +80,6 @@ uploadArchives {
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
artifacts {
archives sourcesJar
}
task proguard(type: JavaExec, dependsOn: fatJar) {
def outFile = fatJar.destinationDir.getPath() + '/' + fatJar.baseName + '-' + fatJar.version + '-small' + '.' + fatJar.extension
inputs.file fatJar.archivePath

View File

@ -64,13 +64,13 @@ if (!('release' in gradle.startParameter.taskNames)) {
task release() {
}
// The projects that get pushed to maven
def maven_release_projects = ['smali', 'baksmali', 'dexlib2', 'util']
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'signing'
group = 'org.smali'
version = parent.version
ext {
@ -93,6 +93,27 @@ subprojects {
mavenCentral()
}
if (project.name in maven_release_projects) {
apply plugin: 'maven'
apply plugin: 'signing'
group = 'org.smali'
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
artifacts {
archives javadocJar
archives sourcesJar
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
@ -140,6 +161,7 @@ subprojects {
tasks.getByPath(':release').dependsOn(uploadArchives)
}
}
buildscript {
repositories {

View File

@ -37,7 +37,3 @@ dependencies {
testCompile 'junit:junit:4.6'
}
// this is a test-only project that we don't need to upload to maven
signArchives.enabled = false
uploadArchives.enabled = false

View File

@ -118,15 +118,6 @@ task accessorTest(type: Test, dependsOn: generateAccessorTestDex) {
classpath = project.sourceSets.accessorTest.runtimeClasspath
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
artifacts {
archives sourcesJar
}
uploadArchives {
repositories.mavenDeployer {
pom.project {

View File

@ -170,15 +170,6 @@ uploadArchives {
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
artifacts {
archives sourcesJar
}
task proguard(type: JavaExec, dependsOn: fatJar) {
def outFile = fatJar.destinationDir.getPath() + '/' + fatJar.baseName + '-' + fatJar.version + '-small' + '.' + fatJar.extension
inputs.file fatJar.archivePath

View File

@ -36,15 +36,6 @@ dependencies {
testCompile depends.junit
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
artifacts {
archives sourcesJar
}
uploadArchives {
repositories.mavenDeployer {
pom.project {