Skip to content

Commit

Permalink
Move signing configuration under same block that controls whether pub…
Browse files Browse the repository at this point in the history
…lishing occurs.
  • Loading branch information
lukecwik committed Apr 6, 2018
1 parent 196d726 commit 4024a8f
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions build_rules.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -505,35 +505,35 @@ ext.applyJavaNature = {
}
artifacts.archives javadocJar

// Only sign artifacts if we are performing a release
if (isRelease()) {
apply plugin: "signing"
signing {
useGpgCmd()
// Drop the unshaded jar because we don't want to publish it.
// Otherwise the unshaded one is the only one published since they
// both have no classifier and the names conflict.
def unshaded = configurations.archives.getArtifacts().matching({
artifact -> artifact.classifier == "" })
configurations.archives.getArtifacts().removeAll(unshaded)
sign configurations.archives
}
if (isRelease() || project.hasProperty('publishing')) {
apply plugin: "maven-publish"

model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
// Only sign artifacts if we are performing a release
if (isRelease()) {
apply plugin: "signing"
signing {
useGpgCmd()
// Drop the unshaded jar because we don't want to publish it.
// Otherwise the unshaded one is the only one published since they
// both have no classifier and the names conflict.
def unshaded = configurations.archives.getArtifacts().matching({
artifact -> artifact.classifier == "" })
configurations.archives.getArtifacts().removeAll(unshaded)
sign configurations.archives
}
tasks.publishMavenJavaPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToMavenRepository {
dependsOn project.tasks.signArchives

model {
tasks.generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}
tasks.publishMavenJavaPublicationToMavenLocal {
dependsOn project.tasks.signArchives
}
tasks.publishMavenJavaPublicationToMavenRepository {
dependsOn project.tasks.signArchives
}
}
}
}

if (isRelease() || project.hasProperty('publishing')) {
apply plugin: "maven-publish"

uploadArchives {
repositories {
Expand Down

0 comments on commit 4024a8f

Please sign in to comment.