Skip to content

Commit 4a2aa18

Browse files
committed
refactor: small rename job
1 parent deaebf1 commit 4a2aa18

File tree

7 files changed

+9
-12
lines changed

7 files changed

+9
-12
lines changed

buildSrc/src/main/kotlin/datadog.test-jvm-contraints.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ tasks.withType<Test>().configureEach {
3535
configureTestJvm(taskExtension)
3636
}
3737

38-
// TODO make this part of the testJvm test task extension
3938
/**
4039
* Provide arguments if condition is met.
4140
*/
42-
fun Test.configureJvmArgs(
41+
fun Test.conditionalJvmArgs(
4342
applyFromVersion: JavaVersion,
4443
jvmArgsToApply: List<String>,
4544
additionalCondition: Provider<Boolean> = project.providers.provider { true }
@@ -58,7 +57,7 @@ fun Test.configureJvmArgs(
5857
* Configure the jvm launcher of the test task and ensure the test task
5958
* can be run with the test task launcher.
6059
*/
61-
fun Test.configureTestJvm(extension: TestJvmConstraintsExtension) {
60+
private fun Test.configureTestJvm(extension: TestJvmConstraintsExtension) {
6261
if (testJvmSpec.javaTestLauncher.isPresent) {
6362
javaLauncher = testJvmSpec.javaTestLauncher
6463
onlyIf("Allowed or forced JDK") {
@@ -71,7 +70,7 @@ fun Test.configureTestJvm(extension: TestJvmConstraintsExtension) {
7170
}
7271

7372
// temporary workaround when using Java16+: some tests require reflective access to java.lang/java.util
74-
configureJvmArgs(
73+
conditionalJvmArgs(
7574
JavaVersion.VERSION_16,
7675
listOf(
7776
"--add-opens=java.base/java.lang=ALL-UNNAMED",

dd-java-agent/agent-bootstrap/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jmh {
7070
}
7171

7272
tasks.withType(Test).configureEach {
73-
configureJvmArgs(
73+
conditionalJvmArgs(
7474
it,
7575
JavaVersion.VERSION_16,
7676
['--add-opens', 'java.base/java.net=ALL-UNNAMED'] // for HostNameResolverForkedTest

dd-java-agent/agent-profiling/profiling-controller-jfr/implementation/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ idea {
5656
}
5757

5858
tasks.withType(Test).configureEach {
59-
configureJvmArgs(
59+
conditionalJvmArgs(
6060
it,
6161
JavaVersion.VERSION_1_9,
6262
[

dd-java-agent/instrumentation/redisson/redisson-2.3.0/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies {
2828

2929
project.afterEvaluate {
3030
tasks.withType(Test).configureEach {
31-
configureJvmArgs(
31+
conditionalJvmArgs(
3232
it,
3333
JavaVersion.VERSION_16,
3434
[

dd-java-agent/instrumentation/redisson/redisson-3.10.3/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232
}
3333

3434
tasks.withType(Test).configureEach {
35-
configureJvmArgs(
35+
conditionalJvmArgs(
3636
it,
3737
JavaVersion.VERSION_16,
3838
[

dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ dependencies {
140140

141141
tasks.withType(Test).configureEach {
142142
// to avoid java.lang.IllegalAccessException: class org.apache.tomcat.util.compat.JreCompat cannot access a member of class java.io.FileSystem (in module java.base) with modifiers "static final"
143-
configureJvmArgs(
143+
conditionalJvmArgs(
144144
it,
145145
JavaVersion.VERSION_16,
146146
['--add-opens', 'java.base/java.io=ALL-UNNAMED']

gradle/java_no_deps.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ def applyCodeCoverage = !(
138138
project.path.startsWith(":dd-java-agent:instrumentation") ||
139139
project.path.startsWith(":dd-java-agent:appsec:weblog:"))
140140

141-
ext.applyCodeCoverage = applyCodeCoverage
142-
143141
// https://stackoverflow.com/questions/42501869/gradle-skip-jacoco-during-test
144142
// https://poetengineer.postach.io/post/how-to-conditionally-enable-disable-jacoco-in-gradle-build
145143
if (applyCodeCoverage) {
@@ -212,7 +210,7 @@ tasks.named("javadoc", Javadoc) {
212210
}
213211
}
214212

215-
ext.configureJvmArgs = (Test testTask, JavaVersion applyFromVersion, List<String> jvmArgsToApply, Provider<Boolean> additionalCondition = null) -> {
213+
ext.conditionalJvmArgs = (Test testTask, JavaVersion applyFromVersion, List<String> jvmArgsToApply, Provider<Boolean> additionalCondition = null) -> {
216214
testTask.jvmArgumentProviders.add(new ProvideJvmArgsOnJvmLauncherVersion(
217215
testTask,
218216
applyFromVersion,

0 commit comments

Comments
 (0)