diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf87d739e1d..986dac19019 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,7 +56,7 @@ variables: BUILD_JOB_NAME: "build" DEPENDENCY_CACHE_POLICY: pull BUILD_CACHE_POLICY: pull - GRADLE_VERSION: "9.7.1" # must match gradle-wrapper.properties + GRADLE_VERSION: "9.8.0" # must match gradle-wrapper.properties MASS_READ_URL: "https://mass-read.us1.ddbuild.io" MAVEN_REPOSITORY_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/" GRADLE_PLUGIN_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/" diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts index 6d1ceec50bb..ffd4783240a 100644 --- a/build-logic/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -1,21 +1,22 @@ pluginManagement { repositories { mavenLocal() - if (settings.extra.has("gradlePluginProxy")) { + providers.gradleProperty("gradlePluginProxy").orNull?.let { proxy -> maven { - url = uri(settings.extra["gradlePluginProxy"] as String) + url = uri(proxy) isAllowInsecureProtocol = true } } - if (settings.extra.has("mavenRepositoryProxy")) { + val mavenRepositoryProxy = providers.gradleProperty("mavenRepositoryProxy").orNull + mavenRepositoryProxy?.let { proxy -> maven { - url = uri(settings.extra["mavenRepositoryProxy"] as String) + url = uri(proxy) isAllowInsecureProtocol = true } } gradlePluginPortal() // TODO: temporary fix for Maven Central rate limiting - if (!settings.extra.has("mavenRepositoryProxy")) { + if (mavenRepositoryProxy == null) { mavenCentral() } } @@ -29,15 +30,16 @@ dependencyResolutionManagement { } repositories { mavenLocal() - if (settings.extra.has("mavenRepositoryProxy")) { + val mavenRepositoryProxy = providers.gradleProperty("mavenRepositoryProxy").orNull + mavenRepositoryProxy?.let { proxy -> maven { - url = uri(settings.extra["mavenRepositoryProxy"] as String) + url = uri(proxy) isAllowInsecureProtocol = true } } gradlePluginPortal() // TODO: temporary fix for Maven Central rate limiting - if (!settings.extra.has("mavenRepositoryProxy")) { + if (mavenRepositoryProxy == null) { mavenCentral() } // Hosts gradle-tooling-api; used by the smoke-test plugin to run nested Gradle builds diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index 0e2e0c39655..b1cea43af42 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -1,3 +1,22 @@ +pluginManagement { + repositories { + mavenLocal() + providers.gradleProperty("gradlePluginProxy").orNull?.let { proxy -> + maven { + url = uri(proxy) + isAllowInsecureProtocol = true + } + } + providers.gradleProperty("mavenRepositoryProxy").orNull?.let { proxy -> + maven { + url = uri(proxy) + isAllowInsecureProtocol = true + } + } + gradlePluginPortal() + } +} + include(":call-site-instrumentation-plugin") include(":modifiable-config-agent") diff --git a/gradle/maven-pom.gradle b/gradle/maven-pom.gradle index 8376a21f4be..6737a4f2b4b 100644 --- a/gradle/maven-pom.gradle +++ b/gradle/maven-pom.gradle @@ -1,28 +1,26 @@ /** Applies the common elements to our generated POM files */ -tasks.withType(GenerateMavenPom).configureEach { - doFirst { - MavenPom pom = it.pom - pom.name = project.name - pom.description = project.description - pom.packaging = "jar" - pom.url = "https://github.com/datadog/dd-trace-java" - pom.licenses { - license { - name = "The Apache Software License, Version 2.0" - url = "http://www.apache.org/licenses/LICENSE-2.0.txt" - distribution = "repo" - } +publishing.publications.withType(MavenPublication).configureEach { + MavenPom pom = it.pom + pom.name = project.name + pom.description = providers.provider { project.description } + pom.packaging = "jar" + pom.url = "https://github.com/datadog/dd-trace-java" + pom.licenses { + license { + name = "The Apache Software License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution = "repo" } - pom.scm { - connection = "scm:https://datadog@github.com/datadog/dd-trace-java" - developerConnection = "scm:git@github.com:datadog/dd-trace-java.git" - url = "https://github.com/datadog/dd-trace-java" - } - pom.developers { - developer { - id = "datadog" - name = "Datadog" - } + } + pom.scm { + connection = "scm:https://datadog@github.com/datadog/dd-trace-java" + developerConnection = "scm:git@github.com:datadog/dd-trace-java.git" + url = "https://github.com/datadog/dd-trace-java" + } + pom.developers { + developer { + id = "datadog" + name = "Datadog" } } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index eddabd2eef8..5097068a8d3 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 760c45969c4..1eca32e7b4b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a -distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip +distributionSha256Sum=bafd5ce9cfaea0fbccfdc8439a1ac42fbd4cd9c89dc9a988228d8a2639a58e6c +distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 diff --git a/gradlew.bat b/gradlew.bat index 8508ef684d4..03754c4c3d9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,33 @@ @rem Set local scope for the variables, and ensure extensions are enabled setlocal EnableExtensions +@rem Catch executions from older scripts and ensure they exit cleanly. +@rem This can be removed once we can be reasonably confident that few people +@rem will be migrating directly to this new wrapper. +goto afterSafetyNet +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +goto exitWithErrorLevel +:afterSafetyNet + set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @rem This is normally unused @@ -45,13 +72,14 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. "%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -59,13 +87,14 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 +1>&2 echo. +1>&2 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +1>&2 echo. +1>&2 echo Please set the JAVA_HOME variable in your environment to match the +1>&2 echo location of your Java installation. "%COMSPEC%" /c exit 1 +goto exitWithErrorLevel :execute @rem Setup the command line @@ -75,8 +104,9 @@ echo location of your Java installation. 1>&2 @rem Execute gradlew @rem endlocal doesn't take effect until after the line is parsed and variables are expanded @rem which allows us to clear the local environment before executing the java command -endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel & goto exitWithErrorLevel +@rem This label must not be changed. We rely on old scripts being able to jump to this point. :exitWithErrorLevel @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts "%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/settings.gradle.kts b/settings.gradle.kts index e557332879d..7d6eb817a65 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,21 +2,22 @@ pluginManagement { repositories { mavenLocal() - if (settings.extra.has("gradlePluginProxy")) { + providers.gradleProperty("gradlePluginProxy").orNull?.let { proxy -> maven { - url = uri(settings.extra["gradlePluginProxy"] as String) + url = uri(proxy) isAllowInsecureProtocol = true } } - if (settings.extra.has("mavenRepositoryProxy")) { + val mavenRepositoryProxy = providers.gradleProperty("mavenRepositoryProxy").orNull + mavenRepositoryProxy?.let { proxy -> maven { - url = uri(settings.extra["mavenRepositoryProxy"] as String) + url = uri(proxy) isAllowInsecureProtocol = true } } gradlePluginPortal() // TODO: temporary fix for Maven Central rate limiting - if (!settings.extra.has("mavenRepositoryProxy")) { + if (mavenRepositoryProxy == null) { mavenCentral() } // Hosts gradle-tooling-api, a transitive dep of the build-logic:smoke-test plugin used diff --git a/test-published-dependencies/settings.gradle.kts b/test-published-dependencies/settings.gradle.kts index 993a60d0005..b4152836356 100644 --- a/test-published-dependencies/settings.gradle.kts +++ b/test-published-dependencies/settings.gradle.kts @@ -1,3 +1,22 @@ +pluginManagement { + repositories { + mavenLocal() + providers.gradleProperty("gradlePluginProxy").orNull?.let { proxy -> + maven { + url = uri(proxy) + isAllowInsecureProtocol = true + } + } + providers.gradleProperty("mavenRepositoryProxy").orNull?.let { proxy -> + maven { + url = uri(proxy) + isAllowInsecureProtocol = true + } + } + gradlePluginPortal() + } +} + rootProject.name = "test-published-dependencies" dependencyResolutionManagement {