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/09/20 21:08:47 UTC

[jmeter] branch master updated: Prepare build scripts for Gradle 6.0

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 250ba4c  Prepare build scripts for Gradle 6.0
250ba4c is described below

commit 250ba4c04064f6fa200c4d0f962ad9d694bf38f4
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Fri Sep 20 20:36:55 2019 +0300

    Prepare build scripts for Gradle 6.0
---
 .../org/apache/jmeter/buildtools/batchtest/BatchTest.kt     |  2 +-
 src/dist/build.gradle.kts                                   |  2 +-
 src/licenses/build.gradle.kts                               | 13 ++++++++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/buildSrc/subprojects/batchtest/src/main/kotlin/org/apache/jmeter/buildtools/batchtest/BatchTest.kt b/buildSrc/subprojects/batchtest/src/main/kotlin/org/apache/jmeter/buildtools/batchtest/BatchTest.kt
index 8658bf7..145bfbb 100644
--- a/buildSrc/subprojects/batchtest/src/main/kotlin/org/apache/jmeter/buildtools/batchtest/BatchTest.kt
+++ b/buildSrc/subprojects/batchtest/src/main/kotlin/org/apache/jmeter/buildtools/batchtest/BatchTest.kt
@@ -107,7 +107,7 @@ open class BatchTest @Inject constructor(objects: ObjectFactory) : JavaExec() {
     init {
         group = BATCH_TESTS_GROUP_NAME
         description = "Runs jmx file via process fork and verifies outputs"
-        configure {
+        configure<BatchTest> {
             workingDir = File(project.rootDir, "bin")
             main = "org.apache.jmeter.NewDriver"
             classpath(jmeterJar)
diff --git a/src/dist/build.gradle.kts b/src/dist/build.gradle.kts
index 90104ca..1e4acdc 100644
--- a/src/dist/build.gradle.kts
+++ b/src/dist/build.gradle.kts
@@ -221,7 +221,7 @@ fun createAnakiaTask(taskName: String,
             include(*includes)
             exclude(*excludes)
         })
-        inputs.properties["extension"] = extension
+        inputs.property("extension", extension)
         outputs.dir(outputDir)
         dependsOn(prepareProps)
 
diff --git a/src/licenses/build.gradle.kts b/src/licenses/build.gradle.kts
index adc2a8a..16afd68 100644
--- a/src/licenses/build.gradle.kts
+++ b/src/licenses/build.gradle.kts
@@ -27,6 +27,17 @@ plugins {
     id("com.github.vlsi.stage-vote-release")
 }
 
+// See https://docs.gradle.org/current/userguide/troubleshooting_dependency_resolution.html#sub:configuration_resolution_constraints
+// Gradle forbids to resolve configurations from other projects, so
+// we create our own copy of the confiruration which belongs to the current project
+// This is the official recommendation:
+// In most cases, the deprecation warning can be fixed by defining a configuration in
+// the project where the resolution is occurring and setting it to extend from the configuration
+// in the other project.
+val binaryDependencies by configurations.creating() {
+    extendsFrom(project(":src:dist").configurations.runtimeClasspath.get())
+}
+
 val gatherSourceLicenses by tasks.registering(GatherLicenseTask::class) {
     addDependency("org.gradle:gradle-wrapper:5.5.1", SpdxLicense.Apache_2_0)
     addDependency(":bootstrap:3.3.4", SpdxLicense.MIT)
@@ -46,7 +57,7 @@ val gatherSourceLicenses by tasks.registering(GatherLicenseTask::class) {
 }
 
 val gatherBinaryLicenses by tasks.registering(GatherLicenseTask::class) {
-    configuration(project(":src:dist").configurations.runtimeClasspath)
+    configuration(binaryDependencies)
     ignoreMissingLicenseFor.add(SpdxLicense.Apache_2_0.asExpression())
     defaultTextFor.add(SpdxLicense.MPL_2_0.asExpression())
     // There are three major cases here: