diff --git a/dd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle b/dd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle index 0b434bb8aac..58a25bc14e9 100644 --- a/dd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle +++ b/dd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle @@ -16,6 +16,11 @@ if (hasProperty('appBuildDir')) { version = "" +// Target Java 8 bytecode as daemon can run on JDK 21 +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + dependencies { implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' diff --git a/dd-smoke-tests/spring-boot-2.7-webflux/application/settings.gradle b/dd-smoke-tests/spring-boot-2.7-webflux/application/settings.gradle index a265d2effdb..0a322538e21 100644 --- a/dd-smoke-tests/spring-boot-2.7-webflux/application/settings.gradle +++ b/dd-smoke-tests/spring-boot-2.7-webflux/application/settings.gradle @@ -1,3 +1,7 @@ +// The `gradlePluginProxy` / `mavenRepositoryProxy` properties point to internal Maven +// mirrors used by CI when the public repos are unreachable; they are forwarded from the +// outer build via the smoke-test plugin. `allowInsecureProtocol` is required because the +// mirrors are reached over plain HTTP inside the CI network. pluginManagement { repositories { mavenLocal() @@ -20,12 +24,16 @@ pluginManagement { def isCI = providers.environmentVariable("CI").isPresent() -// Don't pollute the dependency cache with the build cache +// On CI, point the local Gradle build cache to the shared workspace directory under the +// repository root, so cache entries are reused across the many smoke-test nested builds +// (and across CI jobs that mount the same workspace). See f6ec1f5cc8 / #982 for the +// root-level cache, and b34ccbc048 for the `isCI` gating — locally we keep the default +// per-user cache to avoid leaking entries into the repo tree. +// The directory must line up with the outer project's settings.gradle. if (isCI) { def sharedRootDir = "$rootDir/../../../" buildCache { local { - // This needs to line up with the code in the outer project settings.gradle directory = "$sharedRootDir/workspace/build-cache" } } diff --git a/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle b/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle index ec403dc3c20..b637f51a344 100644 --- a/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle +++ b/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle @@ -1,40 +1,23 @@ -apply from: "$rootDir/gradle/java.gradle" - -description = 'Spring Boot 2.7 Webflux Smoke Tests.' - -dependencies { - testImplementation project(':dd-smoke-tests') +plugins { + id 'dd-trace-java.smoke-test-app' } -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - -// define the task that builds the project -tasks.register('webfluxBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - commandLine "$rootDir/${gradlewCommand}", "bootJar", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } +apply from: "$rootDir/gradle/java.gradle" - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") +description = 'Spring Boot 2.7 Webflux Smoke Tests.' - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) +smokeTestApp { + application { + taskName = 'webfluxBuild' + nestedTasks = ['bootJar'] + artifactPath = 'libs/webflux-2.7-smoketest.jar' + sysProperty = 'datadog.smoketest.webflux.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } -tasks.named("webfluxBuild", Exec) { - dependsOn project(':dd-trace-api').tasks.named("jar") +dependencies { + testImplementation project(':dd-smoke-tests') } tasks.named("compileTestGroovy", GroovyCompile) { @@ -44,10 +27,6 @@ tasks.named("compileTestGroovy", GroovyCompile) { } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.webflux.uberJar.path=$appBuildDir/libs/webflux-2.7-smoketest.jar" -} - spotless { java { target "**/*.java"