Skip to content

Commit

Permalink
publishing works with and without signing
Browse files Browse the repository at this point in the history
  • Loading branch information
miho committed Nov 9, 2021
1 parent 0686e8e commit 0248ce3
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 30 deletions.
4 changes: 0 additions & 4 deletions subprojects/executor/gradle/project-info.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ ext.publishing.developerAlias = 'miho'
ext.publishing.developerEmail = '[email protected]'
ext.publishing.inceptionYear = '2019'

ext.publishing.bintray.repo = 'VSM'
ext.publishing.bintray.userOrg = 'miho'
ext.publishing.bintray.name = project.name

ext.publishing.desc = 'State Machine Model based on VMF (VRL Modeling Framework).'
ext.publishing.license = 'Apache-2.0'
ext.publishing.licenseUrl = 'https://github.com/miho/VMS/blob/master/LICENSE'
Expand Down
33 changes: 22 additions & 11 deletions subprojects/executor/gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Collect publishing information
// -----------------------------------------------------------------------------
ext.publishing = [:]
ext.publishing.bintray = [:]

ext.publishing.pomName = ext.publishing.artifactId

Expand Down Expand Up @@ -155,18 +154,30 @@ publishing {
}

// TODO for some reason 'sign publications.publishing' is null, we search for publications manually
afterEvaluate {
// find publications
def myPublications = [];
tasks.withType(PublishToMavenRepository) { task ->
if(!myPublications.contains(task.publication))
myPublications.add(task.publication)
}
if(
project.findProperty("signing.secretKeyRingFile")
&& project.findProperty("signing.password")
&& project.findProperty("signing.keyId")
) {
afterEvaluate {
// find publications
def myPublications = [];
tasks.withType(PublishToMavenRepository) { task ->
if (!myPublications.contains(task.publication))
myPublications.add(task.publication)
}

signing {
myPublications.each {
sign it
signing {
myPublications.each {
sign it
}
}
}
} else {
println "> skipping signing, provide\n" +
" - 'signing.secretKeyRingFile'\n" +
" - 'signing.password'\n" +
" - 'signing.keyId'\n" +
" to activate it\n"
}

4 changes: 0 additions & 4 deletions subprojects/fsm/gradle/project-info.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ ext.publishing.developerAlias = 'miho'
ext.publishing.developerEmail = '[email protected]'
ext.publishing.inceptionYear = '2019'

ext.publishing.bintray.repo = 'VSM'
ext.publishing.bintray.userOrg = 'miho'
ext.publishing.bintray.name = project.name

ext.publishing.desc = 'State Machine Model based on VMF (VRL Modeling Framework).'
ext.publishing.license = 'Apache-2.0'
ext.publishing.licenseUrl = 'https://github.com/miho/VSM/blob/master/LICENSE'
Expand Down
33 changes: 22 additions & 11 deletions subprojects/fsm/gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Collect publishing information
// -----------------------------------------------------------------------------
ext.publishing = [:]
ext.publishing.bintray = [:]

ext.publishing.pomName = ext.publishing.artifactId

Expand Down Expand Up @@ -155,18 +154,30 @@ publishing {
}

// TODO for some reason 'sign publications.publishing' is null, we search for publications manually
afterEvaluate {
// find publications
def myPublications = [];
tasks.withType(PublishToMavenRepository) { task ->
if(!myPublications.contains(task.publication))
myPublications.add(task.publication)
}
if(
project.findProperty("signing.secretKeyRingFile")
&& project.findProperty("signing.password")
&& project.findProperty("signing.keyId")
) {
afterEvaluate {
// find publications
def myPublications = [];
tasks.withType(PublishToMavenRepository) { task ->
if (!myPublications.contains(task.publication))
myPublications.add(task.publication)
}

signing {
myPublications.each {
sign it
signing {
myPublications.each {
sign it
}
}
}
} else {
println "> skipping signing, provide\n" +
" - 'signing.secretKeyRingFile'\n" +
" - 'signing.password'\n" +
" - 'signing.keyId'\n" +
" to activate it\n"
}

0 comments on commit 0248ce3

Please sign in to comment.