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/11/09 17:37:59 UTC

[jmeter] branch master updated (02d7700 -> ea4ace7)

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

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


    from 02d7700  Add Travis job that executes jmeter-maven-plugin tests
     new c06b9ff  Skip signing for -SNAPSHOT versions
     new ef06709  Specify versions for all Gradle projects
     new ea4ace7  Add option to skip javadoc publication

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .travis.yml               |  5 ++++-
 build.gradle.kts          | 22 +++++++++++++---------
 src/build.gradle.kts      | 21 +++++++++++++++++----
 src/dist/build.gradle.kts | 26 ++++++++++++++++++--------
 4 files changed, 52 insertions(+), 22 deletions(-)


[jmeter] 01/03: Skip signing for -SNAPSHOT versions

Posted by vl...@apache.org.
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

commit c06b9ff01a489b587cb7fbc4cdeed2ebeb4a35ed
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Sat Nov 9 19:52:18 2019 +0300

    Skip signing for -SNAPSHOT versions
---
 build.gradle.kts | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/build.gradle.kts b/build.gradle.kts
index ae3048c..3593625 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -146,6 +146,8 @@ releaseParams {
     }
 }
 
+val isReleaseVersion = rootProject.releaseParams.release.get()
+
 val jacocoReport by tasks.registering(JacocoReport::class) {
     group = "Coverage reports"
     description = "Generates an aggregate report from all subprojects"
@@ -447,26 +449,27 @@ allprojects {
     }
 
     // Not all the modules use publishing plugin
-    plugins.withType<PublishingPlugin> {
-        apply<SigningPlugin>()
-        // Sign all the published artifacts
-        signing {
-            sign(publishing.publications)
+    if (isReleaseVersion && !skipSigning) {
+        plugins.withType<PublishingPlugin> {
+            apply<SigningPlugin>()
+            // Sign all the published artifacts
+            signing {
+                sign(publishing.publications)
+            }
         }
     }
 
     plugins.withType<SigningPlugin> {
         if (useGpgCmd) {
-            configure<SigningExtension> {
+            signing {
                 useGpgCmd()
             }
         }
         afterEvaluate {
-            configure<SigningExtension> {
-                val release = rootProject.releaseParams.release.get()
+            signing {
                 // Note it would still try to sign the artifacts,
                 // however it would fail only when signing a RELEASE version fails
-                isRequired = release && !skipSigning
+                isRequired = isReleaseVersion && !skipSigning
             }
         }
     }


[jmeter] 02/03: Specify versions for all Gradle projects

Posted by vl...@apache.org.
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

commit ef06709a780bc776ecc3b5d839c424d39bb1aeae
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Sat Nov 9 18:53:59 2019 +0300

    Specify versions for all Gradle projects
    
    Even though "projects without versions" might work,
    it seems to be an edge case (e.g. generated pom.xml might contain version=unspecified)
    
    So we specify versions for all the modules, and trim that version from file names when
    generating release artifacts.
---
 .travis.yml               |  3 +++
 build.gradle.kts          |  1 +
 src/dist/build.gradle.kts | 26 ++++++++++++++++++--------
 3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index f962c6d..ead244d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,10 +7,13 @@ install: true
 before_cache:
   - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
   - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
+  - rm -rf $HOME/.m2/repository/org/apache/jmeter
+
 cache:
   directories:
     - $HOME/.gradle/caches/
     - $HOME/.gradle/wrapper/
+    - $HOME/.m2/repository
 
 env:
   global:
diff --git a/build.gradle.kts b/build.gradle.kts
index 3593625..6b4d69f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -280,6 +280,7 @@ if (enableSpotBugs) {
 val licenseHeaderFile = file("config/license.header.java")
 allprojects {
     group = "org.apache.jmeter"
+    version = rootProject.version
     // JMeter ClassFinder parses "class.path" and tries to find jar names there,
     // so we should produce jars without versions names for now
     // version = rootProject.version
diff --git a/src/dist/build.gradle.kts b/src/dist/build.gradle.kts
index 7242dc2..98c537e 100644
--- a/src/dist/build.gradle.kts
+++ b/src/dist/build.gradle.kts
@@ -53,6 +53,12 @@ var jars = arrayOf(
 val buildDocs by configurations.creating {
     isCanBeConsumed = false
 }
+val generatorJar by configurations.creating {
+    isCanBeConsumed = false
+}
+val junitSampleJar by configurations.creating {
+    isCanBeConsumed = false
+}
 val binLicense by configurations.creating {
     isCanBeConsumed = false
 }
@@ -75,6 +81,8 @@ dependencies {
 
     binLicense(project(":src:licenses", "binLicense"))
     srcLicense(project(":src:licenses", "srcLicense"))
+    generatorJar(project(":src:generator", "archives"))
+    junitSampleJar(project(":src:protocol:junit-sample", "archives"))
 
     buildDocs(platform(project(":src:bom")))
     buildDocs("org.apache.velocity:velocity")
@@ -130,10 +138,10 @@ val populateLibs by tasks.registering {
                         jorphanProject, bshclientProject -> libs
                         else -> libsExt
                     }).from(dep.file) {
-                        // Technically speaking, current JMeter artifacts do not have version in the name
-                        // however rename is here just in case
+                        // Remove version from the file name
                         rename { dep.name + "." + dep.extension }
                     }
+
                 else -> libs.from(dep.file)
             }
         }
@@ -147,9 +155,6 @@ libsExt.from(populateLibs)
 binLibs.from(populateLibs)
 
 val copyLibs by tasks.registering(Sync::class) {
-    val junitSampleJar = project(":src:protocol:junit-sample").tasks.named(JavaPlugin.JAR_TASK_NAME)
-    dependsOn(junitSampleJar)
-    val generatorJar = project(":src:generator").tasks.named(JavaPlugin.JAR_TASK_NAME)
     // Can't use $rootDir since Gradle somehow reports .gradle/caches/ as "always modified"
     rootSpec.into("$rootDir/lib")
     with(libs)
@@ -158,15 +163,18 @@ val copyLibs by tasks.registering(Sync::class) {
         // it just removes everything it sees.
         // We configure it to keep txt files that should be present there (the files come from Git source tree)
         include("**/*.txt")
-        // Keep jars in lib/ext so developers don't have to re-install the plugsin again and again
+        // Keep jars in lib/ext so developers don't have to re-install the plugins again and again
         include("ext/*.jar")
+        exclude("ext/ApacheJMeter*.jar")
     }
     into("ext") {
         with(libsExt)
-        from(generatorJar)
+        from(files(generatorJar)) {
+            rename { "ApacheJMeter_generator.jar" }
+        }
     }
     into("junit") {
-        from(junitSampleJar) {
+        from(files(junitSampleJar)) {
             rename { "test.jar" }
         }
     }
@@ -472,6 +480,8 @@ for (type in listOf("binary", "source")) {
             // Gradle defaults to the following pattern, and JMeter was using apache-jmeter-5.1_src.zip
             // [baseName]-[appendix]-[version]-[classifier].[extension]
             archiveBaseName.set("apache-jmeter-${rootProject.version}${if (type == "source") "_src" else ""}")
+            // Discard project version since we want it to be added before "_src"
+            archiveVersion.set("")
             CrLfSpec(eol).run {
                 wa1191SetInputs(gitProps)
                 with(if (type == "source") sourceLayout() else binaryLayout())


[jmeter] 03/03: Add option to skip javadoc publication

Posted by vl...@apache.org.
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

commit ea4ace7b102f492ab07ea797ccd37f10ccff6fb3
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Sat Nov 9 20:25:28 2019 +0300

    Add option to skip javadoc publication
---
 .travis.yml          |  2 +-
 src/build.gradle.kts | 21 +++++++++++++++++----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index ead244d..4ad5c86 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -61,7 +61,7 @@ matrix:
     - name: jmeter-maven-plugin tests
       jdk: openjdk8
       script:
-        - ./gradlew publishToMavenLocal -Pjmeter.version=42.0
+        - ./gradlew -PskipJavadoc publishToMavenLocal -Pjmeter.version=42.0
         - cd ..
         - git clone --depth 100 https://github.com/jmeter-maven-plugin/jmeter-maven-plugin.git
         - cd jmeter-maven-plugin
diff --git a/src/build.gradle.kts b/src/build.gradle.kts
index 812e86f..0885e9a 100644
--- a/src/build.gradle.kts
+++ b/src/build.gradle.kts
@@ -29,6 +29,17 @@ val skipMavenPublication = setOf(
     ":src:testkit-wiremock"
 )
 
+fun Project.boolProp(name: String) =
+    findProperty(name)
+        // Project properties include tasks, extensions, etc, and we want only String properties
+        // We don't want to use "task" as a boolean property
+        ?.let { it as? String }
+        ?.equals("false", ignoreCase = true)?.not()
+
+val skipJavadoc by extra {
+    boolProp("skipJavadoc") ?: false
+}
+
 subprojects {
     if (path == ":src:bom") {
         return@subprojects
@@ -136,10 +147,12 @@ subprojects {
                 version = rootProject.version.toString()
                 from(components["java"])
 
-                // Eager task creation is required due to
-                // https://github.com/gradle/gradle/issues/6246
-                artifact(sourcesJar.get())
-                artifact(javadocJar.get())
+                if (!skipJavadoc) {
+                    // Eager task creation is required due to
+                    // https://github.com/gradle/gradle/issues/6246
+                    artifact(sourcesJar.get())
+                    artifact(javadocJar.get())
+                }
 
                 // Use the resolved versions in pom.xml
                 // Gradle might have different resolution rules, so we set the versions