Permalink
Browse files

Merge pull request #482 from ancho/fix/packaging-is-set-to-pom

fix pom generation for release versions to prevent adding a pom packaging tag
  • Loading branch information...
2 parents 33404dc + 35d6351 commit 77e8070c507124582f57d2151b7e63ae42b1be30 @robertpanzer robertpanzer committed on GitHub Jul 16, 2016
Showing with 36 additions and 29 deletions.
  1. +4 −2 .travis.yml
  2. +4 −1 asciidoctorj-distribution/build.gradle
  3. +9 −1 gradle/deploy.gradle
  4. +14 −21 gradle/publish.gradle
  5. +4 −3 gradle/signing.gradle
  6. +1 −1 test-asciidoctor-upstream.sh
View
@@ -6,10 +6,12 @@ jdk:
- openjdk6
before_script: unset GEM_PATH GEM_HOME JRUBY_OPTS
before_install:
+ - sudo hostname "$(hostname | cut -c1-63)"
+ - (cat /etc/hosts ; echo 127.0.0.1 $(hostname)) | sudo tee /etc/hosts
- sudo apt-get -qq update
- sudo apt-get install -y graphviz
-install: ./gradlew assemble
-script: ./gradlew -S check && bash test-asciidoctor-upstream.sh
+install: ./gradlew -S -Pskip.signing assemble
+script: ./gradlew -S -Pskip.signing check && bash test-asciidoctor-upstream.sh
notifications:
email: false
irc:
@@ -8,7 +8,10 @@ dependencies {
}
jar.enabled = false
-signPom.enabled = false
+
+if ( !project.hasProperty('skip.signing') ) {
+ signPom.enabled = false
+}
configurations.all {
artifacts.clear()
View
@@ -11,6 +11,15 @@ bintray {
configurations = ['archives']
}
+ if ( !project.hasProperty('skip.signing') ) {
+ // Copy the signed pom to bintrayDestination
+ filesSpec {
+ from signPom
+ into signPom.bintrayDestination
+ }
+ bintrayUpload.dependsOn signPom
+ }
+
dryRun = project.hasProperty('dryRun') && project.dryRun.toBoolean()
publish = project.statusIsRelease
@@ -51,4 +60,3 @@ bintray {
}
bintrayUpload.dependsOn build
-bintrayUpload.dependsOn signPom
View
@@ -64,15 +64,6 @@ afterEvaluate {
if (project.tasks.withType(Jar).findByName('javadocJar')) {
artifact javadocJar
}
-
- // register the signed pom file
- // signedPom is an output file from the signPom task
- if (!project.hasProperty('skip.signing')) {
- artifact(signedPom) {
- extension = "pom.asc"
- classifier = null
- }
- }
}
pom.withXml {
@@ -86,25 +77,27 @@ afterEvaluate {
}
}
-task addSignaturesToPublication(dependsOn: signArchives) {
- group "publishing"
- description "add all signatures to the publication"
+if ( !project.hasProperty('skip.signing') ) {
+ task addSignaturesToPublication(dependsOn: signArchives) {
+ group "publishing"
+ description "add all signatures to the publication"
- doLast {
- publishing.publications {
- jars(MavenPublication) {
- configurations.signatures.getArtifacts().each { sig ->
- logger.debug "adding signature to jars publication: $sig"
- artifact(sig){
- extension "jar.asc"
+ doLast {
+ publishing.publications {
+ jars(MavenPublication) {
+ configurations.signatures.getArtifacts().each { sig ->
+ logger.debug "adding signature to jars publication: $sig"
+ artifact(sig) {
+ extension "jar.asc"
+ }
}
}
}
}
}
-}
-tasks["signPom"].finalizedBy addSignaturesToPublication
+ tasks["signPom"].finalizedBy addSignaturesToPublication
+}
// QUESTION should we move manifest creation to general Java plugin config?
jar {
@@ -1,6 +1,3 @@
-ext.pom = file("$buildDir/publications/jars/pom-default.xml")
-ext.signedPom = file("$buildDir/publications/jars/pom-default.xml.asc")
-
if ( !project.hasProperty('skip.signing') ){
apply plugin: 'signing'
@@ -18,6 +15,10 @@ if ( !project.hasProperty('skip.signing') ){
group "publishing"
description "Sign the projects pom file"
+ ext.pom = file("$buildDir/publications/jars/pom-default.xml")
+ ext.signedPom = file("$buildDir/publications/jars/${project.name}-${project.version}.pom.asc")
+ ext.bintrayDestination = "${project.group.replace(".","/")}/${project.name}/${project.version}"
+
inputs.file pom
outputs.file signedPom
@@ -26,5 +26,5 @@ mvn install -Dgemspec=asciidoctor.gemspec
cd ../..
#rm -rf maven
cd ..
-$GRADLE_CMD -S -PasciidoctorGemVersion=$ASCIIDOCTOR_VERSION -PuseMavenLocal=true :asciidoctorj:clean :asciidoctorj:check
+$GRADLE_CMD -S -Pskip.signing -PasciidoctorGemVersion=$ASCIIDOCTOR_VERSION -PuseMavenLocal=true :asciidoctorj:clean :asciidoctorj:check
exit $?

0 comments on commit 77e8070

Please sign in to comment.