jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vladimirsitni...@apache.org
Subject [jmeter] 03/03: Add option to skip javadoc publication
Date Sat, 09 Nov 2019 17:38:02 GMT
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 <sitnikov.vladimir@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


Mime
View raw message