From 0248ce3cf15ad8047913561b8307b4f6ed43d6c5 Mon Sep 17 00:00:00 2001 From: miho Date: Tue, 9 Nov 2021 13:55:02 +0100 Subject: [PATCH] publishing works with and without signing --- .../executor/gradle/project-info.gradle | 4 --- subprojects/executor/gradle/publishing.gradle | 33 ++++++++++++------- subprojects/fsm/gradle/project-info.gradle | 4 --- subprojects/fsm/gradle/publishing.gradle | 33 ++++++++++++------- 4 files changed, 44 insertions(+), 30 deletions(-) diff --git a/subprojects/executor/gradle/project-info.gradle b/subprojects/executor/gradle/project-info.gradle index 139850e..27a7899 100644 --- a/subprojects/executor/gradle/project-info.gradle +++ b/subprojects/executor/gradle/project-info.gradle @@ -9,10 +9,6 @@ ext.publishing.developerAlias = 'miho' ext.publishing.developerEmail = 'info@michaelhoffer.de' 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' diff --git a/subprojects/executor/gradle/publishing.gradle b/subprojects/executor/gradle/publishing.gradle index a9330c8..ddc29f2 100644 --- a/subprojects/executor/gradle/publishing.gradle +++ b/subprojects/executor/gradle/publishing.gradle @@ -2,7 +2,6 @@ // Collect publishing information // ----------------------------------------------------------------------------- ext.publishing = [:] -ext.publishing.bintray = [:] ext.publishing.pomName = ext.publishing.artifactId @@ -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" } diff --git a/subprojects/fsm/gradle/project-info.gradle b/subprojects/fsm/gradle/project-info.gradle index 91a7845..e34a90b 100644 --- a/subprojects/fsm/gradle/project-info.gradle +++ b/subprojects/fsm/gradle/project-info.gradle @@ -10,10 +10,6 @@ ext.publishing.developerAlias = 'miho' ext.publishing.developerEmail = 'info@michaelhoffer.de' 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' diff --git a/subprojects/fsm/gradle/publishing.gradle b/subprojects/fsm/gradle/publishing.gradle index a9330c8..34c0c29 100644 --- a/subprojects/fsm/gradle/publishing.gradle +++ b/subprojects/fsm/gradle/publishing.gradle @@ -2,7 +2,6 @@ // Collect publishing information // ----------------------------------------------------------------------------- ext.publishing = [:] -ext.publishing.bintray = [:] ext.publishing.pomName = ext.publishing.artifactId @@ -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" }