Skip to content

Commit 1e2e37b

Browse files
committed
refactor: Convert remaining usage of min/max jdk properties to our extension
1 parent 4a2aa18 commit 1e2e37b

File tree

60 files changed

+248
-233
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+248
-233
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
22

33
// Set properties before any plugins get loaded
4-
ext {
5-
minJavaVersionForTests = JavaVersion.VERSION_1_8
6-
}
7-
84
apply from: "$rootDir/gradle/java.gradle"
95
apply plugin: 'idea'
106

7+
testJvmConstraint {
8+
minJavaVersionForTests = JavaVersion.VERSION_1_8
9+
}
1110

1211
sourceSets {
1312
"main_java11" {

dd-java-agent/instrumentation/classloading/jboss-testing/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
ext {
1+
apply from: "$rootDir/gradle/java.gradle"
2+
3+
testJvmConstraint {
24
// TODO Java 17: This version of jboss-modules doesn't support Java 17
35
// __redirected.__SAXParserFactory can't access com.sun.org.apache.xerces.internal.jaxp
46
maxJavaVersionForTests = JavaVersion.VERSION_15
57
}
6-
apply from: "$rootDir/gradle/java.gradle"
78

89
dependencies {
910
testImplementation project(':dd-java-agent:instrumentation:classloading')

dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
// Set properties before any plugins get loaded
21
ext {
3-
// Test use Cassandra 3 which requires Java 8. (Currently incompatible with Java 9.)
4-
maxJavaVersionForTests = JavaVersion.VERSION_1_8
52
cassandraDriverTestVersions = "[3.0,4.0)"
63
}
74

8-
95
muzzle {
10-
116
pass {
127
group = "com.datastax.cassandra"
138
module = "cassandra-driver-core"
@@ -43,6 +38,12 @@ muzzle {
4338

4439
apply from: "$rootDir/gradle/java.gradle"
4540

41+
42+
testJvmConstraint {
43+
// Test use Cassandra 3 which requires Java 8. (Currently incompatible with Java 9.)
44+
maxJavaVersionForTests = JavaVersion.VERSION_1_8
45+
}
46+
4647
addTestSuiteForDir('latestDepTest', 'test')
4748

4849
dependencies {

dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.8/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
// Set properties before any plugins get loaded
21
ext {
3-
// Test use Cassandra 3 which requires Java 8. (Currently incompatible with Java 9.)
4-
maxJavaVersionForTests = JavaVersion.VERSION_1_8
52
cassandraDriverTestVersions = "[3.8,4.0)"
63
}
74

8-
95
muzzle {
10-
116
pass {
127
group = "com.datastax.cassandra"
138
module = "cassandra-driver-core"
@@ -19,6 +14,11 @@ muzzle {
1914

2015
apply from: "$rootDir/gradle/java.gradle"
2116

17+
testJvmConstraint {
18+
// Test use Cassandra 3 which requires Java 8. (Currently incompatible with Java 9.)
19+
maxJavaVersionForTests = JavaVersion.VERSION_1_8
20+
}
21+
2222
addTestSuiteForDir('latestDepTest', 'test')
2323

2424
dependencies {

dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
ext {
2-
// TODO Java 17: The embedded cassandra deadlocks on start every time on Java 17
3-
// This can be changed to use test-containers
4-
maxJavaVersionForTests = JavaVersion.VERSION_15
5-
}
6-
71
muzzle {
82
pass {
93
group = "com.datastax.oss"
@@ -15,6 +9,12 @@ muzzle {
159

1610
apply from: "$rootDir/gradle/java.gradle"
1711

12+
testJvmConstraint {
13+
// TODO Java 17: The embedded cassandra deadlocks on start every time on Java 17
14+
// This can be changed to use test-containers
15+
maxJavaVersionForTests = JavaVersion.VERSION_15
16+
}
17+
1818
addTestSuiteForDir('latestDepTest', 'test')
1919

2020
dependencies {

dd-java-agent/instrumentation/elasticsearch/rest-5/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
// Set properties before any plugins get loaded
2-
ext {
3-
// TODO Java 17: The embedded elastic search server doesn't work on Java 17
4-
// This can be changed to use test-containers
5-
maxJavaVersionForTests = JavaVersion.VERSION_15
6-
}
7-
81
muzzle {
92
pass {
103
group = "org.elasticsearch.client"
@@ -24,6 +17,12 @@ muzzle {
2417

2518
apply from: "$rootDir/gradle/java.gradle"
2619

20+
testJvmConstraint {
21+
// TODO Java 17: The embedded elastic search server doesn't work on Java 17
22+
// This can be changed to use test-containers
23+
maxJavaVersionForTests = JavaVersion.VERSION_15
24+
}
25+
2726
addTestSuite('latestDepTest')
2827

2928
dependencies {

dd-java-agent/instrumentation/elasticsearch/transport-2/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// Set properties before any plugins get loaded
2-
ext {
3-
maxJavaVersionForTests = JavaVersion.VERSION_1_8
4-
}
5-
61
muzzle {
72
pass {
83
group = "org.elasticsearch"
@@ -15,6 +10,10 @@ muzzle {
1510

1611
apply from: "$rootDir/gradle/java.gradle"
1712

13+
testJvmConstraint {
14+
maxJavaVersionForTests = JavaVersion.VERSION_1_8
15+
}
16+
1817
addTestSuiteForDir('latestDepTest', 'latestDepTest')
1918

2019
dependencies {

dd-java-agent/instrumentation/elasticsearch/transport-5/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
// Set properties before any plugins get loaded
2-
ext {
3-
// TODO Java 17: The embedded elastic search server doesn't work on Java 17
4-
// This can be changed to use test-containers
5-
maxJavaVersionForTests = JavaVersion.VERSION_15
6-
}
7-
81
muzzle {
92
pass {
103
group = "org.elasticsearch.client"
@@ -24,6 +17,12 @@ muzzle {
2417

2518
apply from: "$rootDir/gradle/java.gradle"
2619

20+
testJvmConstraint {
21+
// TODO Java 17: The embedded elastic search server doesn't work on Java 17
22+
// This can be changed to use test-containers
23+
maxJavaVersionForTests = JavaVersion.VERSION_15
24+
}
25+
2726
dependencies {
2827
compileOnly group: 'org.elasticsearch.client', name: 'transport', version: '5.0.0'
2928

dd-java-agent/instrumentation/glassfish-3.0/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
ext {
2-
maxJavaVersionForTests = JavaVersion.VERSION_1_8
3-
}
4-
51
muzzle {
62
pass {
73
group = 'org.glassfish.main.extras'
@@ -14,6 +10,10 @@ muzzle {
1410

1511
apply from: "$rootDir/gradle/java.gradle"
1612

13+
testJvmConstraint {
14+
maxJavaVersionForTests = JavaVersion.VERSION_1_8
15+
}
16+
1717
addTestSuiteForDir('latestDepTest', 'test')
1818

1919
dependencies {

dd-java-agent/instrumentation/ignite-2.0/build.gradle

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
ext {
2-
// See https://ignite.apache.org/docs/latest/quick-start/java#running-ignite-with-java-11-or-later
3-
// FIXME: Because of this condition, tests only run in Java 8, and latestDepTest never run, as they require Java 11+.
4-
maxJavaVersionForTests = JavaVersion.VERSION_1_8
5-
}
6-
71
muzzle {
82
pass {
93
group = 'org.apache.ignite'
@@ -21,16 +15,18 @@ muzzle {
2115

2216
apply from: "$rootDir/gradle/java.gradle"
2317

18+
testJvmConstraint {
19+
// See https://ignite.apache.org/docs/latest/quick-start/java#running-ignite-with-java-11-or-later
20+
// FIXME: Because of this condition, tests only run in Java 8, and latestDepTest never run, as they require Java 11+.
21+
maxJavaVersionForTests = JavaVersion.VERSION_1_8
22+
}
23+
2424
addTestSuiteForDir('latestDepTest', 'test')
2525
addTestSuiteExtendingForDir('latestDepForkedTest', 'latestDepTest', 'test')
2626
// ignite 2.16.0 latest version compatible with Java 8
2727
addTestSuiteForDir('ignite216Test', 'test')
2828
addTestSuiteExtendingForDir('ignite216ForkedTest', 'ignite216Test', 'test')
2929

30-
testJvmConstraint {
31-
minJavaVersionForTests = JavaVersion.VERSION_11
32-
}
33-
3430
dependencies {
3531
compileOnly group: 'org.apache.ignite', name: 'ignite-core', version: '2.0.0'
3632

@@ -44,8 +40,17 @@ dependencies {
4440
latestDepTestImplementation group: 'org.apache.ignite', name: 'ignite-indexing', version: '2.+'
4541
}
4642

47-
for (task in ['compileLatestDepTestGroovy', 'compileLatestDepForkedTestGroovy']) {
48-
tasks.named(task, GroovyCompile) {
43+
for (taskName in ['compileLatestDepTestGroovy', 'compileLatestDepForkedTestGroovy']) {
44+
tasks.named(taskName, GroovyCompile) {
4945
configureCompiler(it, 11)
5046
}
5147
}
48+
49+
for (taskName in ['latestDepTest', 'latestDepForkedTest']) {
50+
tasks.named(taskName, Test) {
51+
testJvmConstraint {
52+
// ignite 2.17.0+ requires Java 11+
53+
minJavaVersionForTests = JavaVersion.VERSION_11
54+
}
55+
}
56+
}

0 commit comments

Comments
 (0)