You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by vl...@apache.org on 2019/12/22 13:07:56 UTC

[jmeter] branch master updated: Move PGP signing to com.github.vlsi.stage-vote-release Gradle plugin

This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new db0eb12  Move PGP signing to com.github.vlsi.stage-vote-release Gradle plugin
db0eb12 is described below

commit db0eb12e42711fd60778f2737a6fe8bd53a31856
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Wed Nov 20 13:19:46 2019 +0300

    Move PGP signing to com.github.vlsi.stage-vote-release Gradle plugin
---
 build.gradle.kts             | 82 +++++---------------------------------------
 checksum.xml                 | 15 ++++----
 gradle.properties            |  4 +--
 settings.gradle.kts          |  9 ++---
 src/dist/build.gradle.kts    |  1 -
 src/release/build.gradle.kts |  2 +-
 6 files changed, 25 insertions(+), 88 deletions(-)

diff --git a/build.gradle.kts b/build.gradle.kts
index 83c66aa..8df1537 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -23,6 +23,8 @@ import com.github.vlsi.gradle.crlf.LineEndings
 import com.github.vlsi.gradle.crlf.filter
 import com.github.vlsi.gradle.git.FindGitAttributes
 import com.github.vlsi.gradle.git.dsl.gitignore
+import com.github.vlsi.gradle.properties.dsl.lastEditYear
+import com.github.vlsi.gradle.properties.dsl.props
 import com.github.vlsi.gradle.release.RepositoryType
 import org.ajoberstar.grgit.Grgit
 import org.gradle.api.tasks.testing.logging.TestExceptionFormat
@@ -40,7 +42,6 @@ plugins {
     id("com.github.vlsi.crlf")
     id("com.github.vlsi.ide")
     id("com.github.vlsi.stage-vote-release")
-    signing
     publishing
 }
 
@@ -77,16 +78,7 @@ println("Building JMeter $version")
 
 fun reportsForHumans() = !(System.getenv()["CI"]?.toBoolean() ?: boolProp("CI") ?: false)
 
-val lastEditYear by extra {
-    file("$rootDir/NOTICE")
-        .readLines()
-        .first { it.contains("Copyright") }
-        .let {
-            """Copyright \d{4}-(\d{4})""".toRegex()
-                .find(it)?.groupValues?.get(1)
-                ?: throw IllegalStateException("Unable to identify copyright year from $rootDir/NOTICE")
-        }
-}
+val lastEditYear by extra(lastEditYear().toString())
 
 // This task scans the project for gitignore / gitattributes, and that is reused for building
 // source/binary artifacts with the appropriate eol/executable file flags
@@ -143,16 +135,8 @@ releaseParams {
             stagingProfileId.set("4d29c092016673")
         }
     }
-    validateBeforeBuildingReleaseArtifacts += Runnable {
-        if (useGpgCmd && findProperty("signing.gnupg.keyName") == null) {
-            throw GradleException("Please specify signing key id via signing.gnupg.keyName " +
-                    "(see https://github.com/gradle/gradle/issues/8657)")
-        }
-    }
 }
 
-val isReleaseVersion = rootProject.releaseParams.release.get()
-
 val jacocoReport by tasks.registering(JacocoReport::class) {
     group = "Coverage reports"
     description = "Generates an aggregate report from all subprojects"
@@ -163,37 +147,15 @@ val jacocoEnabled by extra {
 }
 
 // Do not enable spotbugs by default. Execute it only when -Pspotbugs is present
-val enableSpotBugs by extra {
-    boolProp("spotbugs") ?: false
-}
-
-val ignoreSpotBugsFailures by extra {
-    boolProp("ignoreSpotBugsFailures") ?: false
-}
-
-val skipCheckstyle by extra {
-    boolProp("skipCheckstyle") ?: false
-}
-
-val skipSpotless by extra {
-    boolProp("skipSpotless") ?: false
-}
-
+val enableSpotBugs = props.bool("spotbugs", default = false)
+val ignoreSpotBugsFailures by props()
+val skipCheckstyle by props()
+val skipSpotless by props()
 // Allow to skip building source/binary distributions
 val skipDist by extra {
     boolProp("skipDist") ?: false
 }
-
-// By default use Java implementation to sign artifacts
-// When useGpgCmd=true, then gpg command line tool is used for signing
-val useGpgCmd by extra {
-    boolProp("useGpgCmd") ?: false
-}
-
-// Signing is required for RELEASE version
-val skipSigning by extra {
-    boolProp("skipSigning") ?: boolProp("skipSign") ?: false
-}
+// Inherited from stage-vote-release-plugin: skipSign, useGpgCmd
 
 allprojects {
     if (project.path != ":src") {
@@ -334,7 +296,7 @@ allprojects {
             val sourceSets: SourceSetContainer by project
             if (sourceSets.isNotEmpty()) {
                 tasks.register("checkstyleAll") {
-                    dependsOn(sourceSets.names.map { "checkstyle" + it.capitalize() })
+                    dependsOn(tasks.withType<Checkstyle>())
                 }
                 tasks.register("checkstyle") {
                     group = LifecycleBasePlugin.VERIFICATION_GROUP
@@ -457,32 +419,6 @@ allprojects {
         fileMode = "664".toInt(8)
     }
 
-    // Not all the modules use publishing plugin
-    if (isReleaseVersion && !skipSigning) {
-        plugins.withType<PublishingPlugin> {
-            apply<SigningPlugin>()
-            // Sign all the published artifacts
-            signing {
-                sign(publishing.publications)
-            }
-        }
-    }
-
-    plugins.withType<SigningPlugin> {
-        if (useGpgCmd) {
-            signing {
-                useGpgCmd()
-            }
-        }
-        afterEvaluate {
-            signing {
-                // Note it would still try to sign the artifacts,
-                // however it would fail only when signing a RELEASE version fails
-                isRequired = isReleaseVersion && !skipSigning
-            }
-        }
-    }
-
     plugins.withType<JavaPlugin> {
         // This block is executed right after `java` plugin is added to a project
         java {
diff --git a/checksum.xml b/checksum.xml
index a4e366b..5ff5851 100644
--- a/checksum.xml
+++ b/checksum.xml
@@ -144,17 +144,20 @@
     <dependency group='com.github.bulenkov.darcula' module='darcula' version='e208efb96f70e4be9dc362fbb46f6e181ef501dd'>
       <sha512>80F3335D8EA3FB3FF07A12A79C958C4E3F8BB542511C52825A8B3694AC96F027E24396CE9EDCEFA44EE93B5CBED4E4AED4575E6AAED56F363BAE92C52EE85D22</sha512>
     </dependency>
-    <dependency group='com.github.vlsi.gradle' module='crlf-plugin' version='1.46.0'>
+    <dependency group='com.github.vlsi.gradle' module='crlf-plugin' version='1.52'>
       <sha512>9C5D7C21CFB40356F4B425A6BAED753E6FBC7E6966AA09715F4E5734DD77AEB6F1E0E0810C157288E7E124E535569C4BAE0826FC70A6F5AB8538CCF53AAF7D53</sha512>
     </dependency>
-    <dependency group='com.github.vlsi.gradle' module='ide-plugin' version='1.46.0'>
-      <sha512>D45B68FCBC056DAC44D64046FAC6395DBA9FC7C7690601F31F1A17A09BC02F977BF65B4CA5FB196848C6D5BB283BD92D31D29DF87BEEB28AD98A253E60BECE19</sha512>
+    <dependency group='com.github.vlsi.gradle' module='gradle-extensions-plugin' version='1.52'>
+      <sha512>342052E5CE7625248D16093C0F2EF5EE2EE5C3294202694E88F529073DE36A2D46851BD2DEB692A2C8560970C066DD3E83B803070844D3C0C30D0A366D81396</sha512>
     </dependency>
-    <dependency group='com.github.vlsi.gradle' module='license-gather-plugin' version='1.46.0'>
+    <dependency group='com.github.vlsi.gradle' module='ide-plugin' version='1.52'>
+      <sha512>E9B898EDEB23483C537B4F250FA325B9D7AAEF3B479576006026C8AA1C4BF4D6DD5CCE96B05CE638920F70C81E19BCEF36FB4414B150F5AEE79D11F3EF445EB8</sha512>
+    </dependency>
+    <dependency group='com.github.vlsi.gradle' module='license-gather-plugin' version='1.52'>
       <sha512>8D0D8E6BB53A26731AB869E69653A94400F3D44077FB4A4898FE8D8988FAC5BF47E0077FAFDCC80BE75906EA4B6209C0C9646874B30C0798C18871391A824DB5</sha512>
     </dependency>
-    <dependency group='com.github.vlsi.gradle' module='stage-vote-release-plugin' version='1.46.0'>
-      <sha512>DB9B9B360BAC8D081032AE03694E9FE83B748D8F5E7CD33BBEDC000897EDC4062F24C4DB2A650440B5C0222E65CAF9DFECBC3AB8E82204C931E8F1BCDD51EF76</sha512>
+    <dependency group='com.github.vlsi.gradle' module='stage-vote-release-plugin' version='1.52'>
+      <sha512>519A9DF63778CA8479C014AE7E6FCF025EF85D5DBF69CF23D54C7E8DB3AD379DC0D79D0F24B42195B190B3008159D750E2206864BBE58F82378C62F80569AD67</sha512>
     </dependency>
     <dependency group='commons-logging' module='commons-logging' version='1.0.4'>
       <sha512>C8D2D39A60ADCC49091D393DAF30473D1776E4B6B09BB86639171F660833A17AFBDC9F3E85843093535DA16FA664CD7CD4CA38F54E141018DD1B78DE681AD668</sha512>
diff --git a/gradle.properties b/gradle.properties
index ad7d8be..54c7302 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -36,9 +36,7 @@ com.diffplug.gradle.spotless.version=3.25.0
 com.github.spotbugs.version=2.0.0
 com.github.vlsi.checksum-dependency.sha512=993FD75CCCE1618BBE64BB2ED55242836C2B01442AD0AE98DA03CD672EAFF935567921304B6E8705AAE87367FDF7B8FF684C992A45E8008DDB4EF7E73FEA4DAD
 com.github.vlsi.checksum-dependency.version=1.46.0
-com.github.vlsi.crlf.version=1.46.0
-com.github.vlsi.ide.version=1.46.0
-com.github.vlsi.stage-vote-release.version=1.46.0
+com.github.vlsi.vlsi-release-plugins.version=1.52
 org.jetbrains.gradle.plugin.idea-ext.version=0.5
 org.nosphere.apache.rat.version=0.5.3
 org.sonarqube.version=2.7.1
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 9012a66..b6b7295 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -18,13 +18,14 @@
 
 pluginManagement {
     plugins {
-        fun PluginDependenciesSpec.idv(id: String) = id(id) version extra["$id.version"].toString()
+        fun String.v() = extra["$this.version"].toString()
+        fun PluginDependenciesSpec.idv(id: String, key: String = id) = id(id) version key.v()
 
         idv("com.diffplug.gradle.spotless")
         idv("com.github.spotbugs")
-        idv("com.github.vlsi.crlf")
-        idv("com.github.vlsi.ide")
-        idv("com.github.vlsi.stage-vote-release")
+        idv("com.github.vlsi.crlf", "com.github.vlsi.vlsi-release-plugins")
+        idv("com.github.vlsi.ide", "com.github.vlsi.vlsi-release-plugins")
+        idv("com.github.vlsi.stage-vote-release", "com.github.vlsi.vlsi-release-plugins")
         idv("org.jetbrains.gradle.plugin.idea-ext")
         idv("org.nosphere.apache.rat")
         idv("org.sonarqube")
diff --git a/src/dist/build.gradle.kts b/src/dist/build.gradle.kts
index ff9a90f..87d41f0 100644
--- a/src/dist/build.gradle.kts
+++ b/src/dist/build.gradle.kts
@@ -25,7 +25,6 @@ import org.gradle.api.internal.TaskOutputsInternal
 plugins {
     id("com.github.vlsi.crlf")
     id("com.github.vlsi.stage-vote-release")
-    signing
 }
 
 var jars = arrayOf(
diff --git a/src/release/build.gradle.kts b/src/release/build.gradle.kts
index 2c89e97..aba855f 100644
--- a/src/release/build.gradle.kts
+++ b/src/release/build.gradle.kts
@@ -67,7 +67,7 @@ Keys are here:
 https://www.apache.org/dist/$tlpUrl/KEYS
 
 N.B.
-To create the distribution and test $tlp: "./gradlew build -Prelease -PskipSigning".
+To create the distribution and test $tlp: "./gradlew build -Prelease -PskipSign".
 
 $tlp $version requires Java 8 or later to run.