From b9bc0ef76bf0341c87c603f8ddd46f9495207ebf Mon Sep 17 00:00:00 2001 From: Santiago Mola Date: Sat, 24 May 2025 20:57:01 +0200 Subject: [PATCH] Upgrade to gradle v8.5 --- .gitlab-ci.yml | 2 +- dd-java-agent/instrumentation/scala/build.gradle | 16 +++++++++++++--- gradle/wrapper/gradle-wrapper.properties | 4 ++-- gradlew | 14 +++++++------- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5fc264a07c1..0371b8a74ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ variables: BUILD_JOB_NAME: "build" DEPENDENCY_CACHE_POLICY: pull BUILD_CACHE_POLICY: pull - GRADLE_VERSION: "8.4" # must match gradle-wrapper.properties + GRADLE_VERSION: "8.5" # must match gradle-wrapper.properties MAVEN_REPOSITORY_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/maven-central/" GRADLE_PLUGIN_PROXY: "http://artifactual.artifactual.all-clusters.local-dc.fabric.dog:8081/repository/gradle-plugin-portal-proxy/" JAVA_BUILD_IMAGE_VERSION: "v25.05" diff --git a/dd-java-agent/instrumentation/scala/build.gradle b/dd-java-agent/instrumentation/scala/build.gradle index bbc9bbe38ad..8620cd7cffa 100644 --- a/dd-java-agent/instrumentation/scala/build.gradle +++ b/dd-java-agent/instrumentation/scala/build.gradle @@ -27,7 +27,17 @@ final testTasks = scalaVersions.collect { scalaLibrary -> def (major, minor) = version.split('_').collect(Integer.&valueOf) final javaConcatenation = major > 2 || minor > 11 // after 2.11 scala uses java.lang.StringBuilder to perform concatenation - final configuration = configurations.create("${version}Implementation") + final configuration = configurations.create("${version}Implementation") { + canBeConsumed = false + canBeResolved = false + canBeDeclared = true + } + final classPathConfiguration = configurations.create("${version}CompileClasspath") { + canBeConsumed = false + canBeResolved = true + canBeDeclared = false + extendsFrom(configuration) + } dependencies { handler -> handler.add(configuration.name, scalaLibrary) @@ -40,7 +50,7 @@ final testTasks = scalaVersions.collect { scalaLibrary -> final customSourceSet = sourceSets.create("${version}") { scala { srcDirs = ['src/test/scala'] - compileClasspath += configuration + compileClasspath += classPathConfiguration } } @@ -49,7 +59,7 @@ final testTasks = scalaVersions.collect { scalaLibrary -> .filter { !it.toString().contains('scala-library') } // exclude default scala-library .minus(files(sourceSets.test.scala.classesDirectory)) // exclude default /build/classes/scala/test folder .plus(customSourceSet.output.classesDirs) // add /build/classes/scala/${version} folder - .plus(configuration) // add new scala-library configuration + .plus(classPathConfiguration) // add new scala-library configuration systemProperty('uses.java.concat', javaConcatenation) dependsOn(tasks.named("compile${version.capitalize()}Scala")) group = 'verification' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 29677ce465a..74bda5be9a9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,8 +2,8 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists # Please note that the version specific cache directory in # .gitlab-ci.yml needs to match this version. -distributionSha256Sum=f2b9ed0faf8472cbe469255ae6c86eddb77076c75191741b4a462f33128dd419 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip +distributionSha256Sum=c16d517b50dd28b3f5838f0e844b7520b8f1eb610f2f29de7e4e04a1b7c9c79b +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1a532..1aa94a42690 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \