Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ excludedClassesCoverage += ['com.datadog.profiling.controller.jfr.JdkTypeIDs']

// Shared JFR implementation. The earliest Java version JFR is working on is Java 8

tasks.named("compileTestJava") {
tasks.named("compileTestJava", JavaCompile) {
setJavaVersion(it, 11)
// tests should be compiled in Java 8 compatible way
sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply from: "$rootDir/gradle/test-with-scala.gradle"
addTestSuite('akka23Test')
addTestSuiteForDir('latestDepTest', 'test')

tasks.named("compileAkka23TestGroovy") {
tasks.named("compileAkka23TestGroovy", GroovyCompile) {
classpath += files(sourceSets.akka23Test.scala.classesDirectory)
}

Expand All @@ -41,7 +41,7 @@ sourceSets {
}
}
}
tasks.named("compileLatestDepTestGroovy") {
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
classpath += files(sourceSets.latestDepTest.scala.classesDirectory)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,27 @@ repositories {

addTestSuiteForDir('latestDepTest', 'test')

[compileMain_java11Java, compileTestScala, compileLatestDepTestScala].each {
it.configure {
tasks.named("compileMain_java11Java", JavaCompile) {
setJavaVersion(it, 11)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

["compileTestScala", "compileLatestDepTestScala"].each { name ->
tasks.named(name, ScalaCompile) {
setJavaVersion(it, 11)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

compileTestGroovy {
tasks.named("compileTestGroovy", GroovyCompile) {
javaLauncher = getJavaLauncherFor(11)
dependsOn compileTestScala
classpath += files(compileTestScala.destinationDirectory)
}

compileLatestDepTestGroovy {
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
javaLauncher = getJavaLauncherFor(11)
dependsOn compileLatestDepTestScala
classpath += files(compileLatestDepTestScala.destinationDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ addTestSuiteForDir("jetty11Test", "test/jetty11")
addTestSuiteExtendingForDir("jetty9LatestDepTest", "latestDepTest", "test/jetty9")
addTestSuiteExtendingForDir("jetty11LatestDepTest", "latestDepTest", "test/jetty11")

[compileJetty11TestGroovy, jetty11Test, compileJetty11LatestDepTestGroovy, jetty11LatestDepTest].each {
it.configure {
["compileJetty11TestGroovy", "compileJetty11LatestDepTestGroovy"].each { name ->
tasks.named(name, GroovyCompile) {
javaLauncher = getJavaLauncherFor(11)
}
}

["jetty11Test", "jetty11LatestDepTest"].each { name ->
tasks.named(name, Test) {
javaLauncher = getJavaLauncherFor(11)
}
}
Expand Down
8 changes: 4 additions & 4 deletions dd-java-agent/instrumentation/axis2-1.3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ configurations.configureEach {
}
}

[compileLatestDepForkedTestGroovy, compileLatestDepTestGroovy].each {
it.configure {
["compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy"].each { name ->
tasks.named(name, GroovyCompile) {
javaLauncher = getJavaLauncherFor(11)
}
}

[compileLatestDepForkedTestJava, compileLatestDepTestJava].each {
it.configure {
["compileLatestDepForkedTestJava", "compileLatestDepTestJava"].each { name ->
tasks.named(name, JavaCompile) {
setJavaVersion(it, 11)
}
}
Expand Down
40 changes: 20 additions & 20 deletions dd-java-agent/instrumentation/cxf-2.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@ apply from: "${rootDir}/gradle/java.gradle"
addTestSuite('latestDepTest')
addTestSuiteForDir('cxf3LatestDepTest', 'test')

[compileCxf3LatestDepTestJava].each {
it.configure {
setJavaVersion(it, 11)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.named("compileCxf3LatestDepTestJava", JavaCompile) {
setJavaVersion(it, 11)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

[compileLatestDepTestJava].each {
it.configure {
setJavaVersion(it, 17)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.named("compileLatestDepTestJava", JavaCompile) {
setJavaVersion(it, 17)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

[compileLatestDepTestGroovy, latestDepTest].each {
it.configure {
javaLauncher = getJavaLauncherFor(17)
}
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
javaLauncher = getJavaLauncherFor(17)
}

[compileCxf3LatestDepTestGroovy, cxf3LatestDepTest].each {
it.configure {
javaLauncher = getJavaLauncherFor(11)
}
tasks.named("latestDepTest", Test) {
javaLauncher = getJavaLauncherFor(17)
}

tasks.named("compileCxf3LatestDepTestGroovy", GroovyCompile) {
javaLauncher = getJavaLauncherFor(11)
}

tasks.named("cxf3LatestDepTest", Test) {
javaLauncher = getJavaLauncherFor(11)
}

dependencies {
Expand Down
12 changes: 7 additions & 5 deletions dd-java-agent/instrumentation/exception-profiling/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ dependencies {
}

// Must use Java 11 to build JFR enabled code - there is no JFR in OpenJDK 8 (revisit once JFR in Java 8 is available)
[compileMain_java11Java, compileTestJava].each {
setJavaVersion(it, 11)
it.sourceCompatibility = JavaVersion.VERSION_1_8
it.targetCompatibility = JavaVersion.VERSION_1_8
it.options.compilerArgs.addAll(['-Xlint:all,-processing,-options,-path'])
["compileMain_java11Java", "compileTestJava"].each { name ->
tasks.named(name, JavaCompile) {
setJavaVersion(it, 11)
it.sourceCompatibility = JavaVersion.VERSION_1_8
it.targetCompatibility = JavaVersion.VERSION_1_8
it.options.compilerArgs.addAll(['-Xlint:all,-processing,-options,-path'])
}
}

forbiddenApisMain_java11 {
Expand Down
4 changes: 2 additions & 2 deletions dd-java-agent/instrumentation/finatra-2.9/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ dependencies {
latestDepTestImplementation group: 'com.twitter', name: 'finatra-http_2.11', version: '+'
}

tasks.named("compileLatestDepTestGroovy") {
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
classpath = classpath.plus(files(compileLatestDepTestScala.destinationDirectory))
dependsOn "compileLatestDepTestScala"
}

tasks.named("compileLatestPre207TestGroovy") {
tasks.named("compileLatestPre207TestGroovy", GroovyCompile) {
classpath = classpath.plus(files(compileLatestPre207TestScala.destinationDirectory))
dependsOn "compileLatestPre207TestScala"
}
Expand Down
24 changes: 13 additions & 11 deletions dd-java-agent/instrumentation/graal/native-image/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ muzzle {
apply from: "$rootDir/gradle/java.gradle"
apply plugin: "idea"

[compileMain_java11Java, compileTestJava].each {
it.sourceCompatibility = JavaVersion.VERSION_11
it.targetCompatibility = JavaVersion.VERSION_11
setJavaVersion(it, 11)
it.options.compilerArgs.addAll([
'-Xlint:all,-processing,-options,-path',
'--add-modules',
'jdk.internal.vm.ci',
'--add-exports',
'jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED'
])
["compileMain_java11Java", "compileTestJava"].each { name ->
tasks.named(name, JavaCompile) {
it.sourceCompatibility = JavaVersion.VERSION_11
it.targetCompatibility = JavaVersion.VERSION_11
setJavaVersion(it, 11)
it.options.compilerArgs.addAll([
'-Xlint:all,-processing,-options,-path',
'--add-modules',
'jdk.internal.vm.ci',
'--add-exports',
'jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED'
])
}
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ apply from: "$rootDir/gradle/java.gradle"
addTestSuiteForDir('latestDepTest', 'test')
addTestSuiteExtendingForDir('latestDepJava11Test', 'latestDepTest', 'test')

tasks.named("compileLatestDepJava11TestJava") {
tasks.named("compileLatestDepJava11TestJava", JavaCompile) {
setJavaVersion(it, 11)
}
tasks.named("compileLatestDepJava11TestGroovy") {
tasks.named("compileLatestDepJava11TestGroovy", GroovyCompile) {
javaLauncher = getJavaLauncherFor(11)
}
tasks.named("latestDepJava11Test") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ apply from: "$rootDir/gradle/java.gradle"
apply plugin: "idea"

// Must use Java 11 to build JFR enabled code - there is no JFR in OpenJDK 8 (revisit once JFR in Java 8 is available)
[compileMain_java11Java, compileTestJava].each {
it.sourceCompatibility = JavaVersion.VERSION_11
it.targetCompatibility = JavaVersion.VERSION_11
setJavaVersion(it, 11)
it.options.compilerArgs.addAll(['-Xlint:all,-processing,-options,-path'])
["compileMain_java11Java", "compileTestJava"].each { name ->
tasks.named(name, JavaCompile) {
it.sourceCompatibility = JavaVersion.VERSION_11
it.targetCompatibility = JavaVersion.VERSION_11
setJavaVersion(it, 11)
it.options.compilerArgs.addAll(['-Xlint:all,-processing,-options,-path'])
}
}

forbiddenApisMain_java11 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ apply from: "$rootDir/gradle/java.gradle"
apply plugin: "idea"


tasks.named("compileMain_java11Java") {
tasks.named("compileMain_java11Java", JavaCompile) {
it.sourceCompatibility = JavaVersion.VERSION_11
it.targetCompatibility = JavaVersion.VERSION_11
setJavaVersion(it, 11)
Expand Down
4 changes: 2 additions & 2 deletions dd-java-agent/instrumentation/jdbc/scalikejdbc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ apply plugin: 'scala'

addTestSuiteForDir('latestDepTest', 'test')

tasks.named("compileTestGroovy") {
tasks.named("compileTestGroovy", GroovyCompile) {
dependsOn "compileTestScala"
classpath += files(compileTestScala.destinationDirectory)
}

tasks.named("compileLatestDepTestGroovy") {
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
dependsOn "compileLatestDepTestScala"
classpath += files(compileLatestDepTestScala.destinationDirectory)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,24 @@ addTestSuiteExtendingForDir('ee10ForkedTest', 'ee10Test', 'test/ee10')
addTestSuiteExtendingForDir('ee10LatestDepTest', 'latestDepTest', 'test/ee10')
addTestSuiteExtendingForDir('ee10LatestDepForkedTest', 'ee10LatestDepTest', 'test/ee10')

[compileMain_java17Java, compileTestJava].each {
it.configure {
["compileMain_java17Java", "compileTestJava"].each { name ->
tasks.named(name, JavaCompile) {
setJavaVersion(it, 17)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
[ee8LatestDepTest, ee9LatestDepTest, ee10LatestDepTest].each {
it.configure {

["ee8LatestDepTest", "ee9LatestDepTest", "ee10LatestDepTest"].each { name ->
tasks.named(name, Test) {
it.jvmArgs += ['-Dtest.dd.latestDepTest=true']
}
}

forbiddenApisMain_java17 {
failOnMissingClasses = false
}

tasks.withType(GroovyCompile).configureEach {
javaLauncher = getJavaLauncherFor(17)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ instrument {
]
}

tasks.named("compileMain_jetty10Java") {
tasks.named("compileMain_jetty10Java", JavaCompile) {
setJavaVersion(it, 11)
}

Expand All @@ -117,7 +117,7 @@ addTestSuiteForDir('latestDepForkedTest', 'test')
tasks.named("latestDepForkedTest") {
javaLauncher = getJavaLauncherFor(11)
}
tasks.named("compileLatestDepForkedTestGroovy") {
tasks.named("compileLatestDepForkedTestGroovy", GroovyCompile) {
setJavaVersion(it, 11)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ muzzle {

addTestSuiteForDir('latestDepTest', 'test')

tasks.named("compileLatestDepTestGroovy") {
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
classpath += files(compileLatestDepTestKotlin.destinationDirectory)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ configurations.matching({ it.name.startsWith('test') }).each({
}
})

tasks.named("compileLatestDepTestJava") {
tasks.named("compileLatestDepTestJava", JavaCompile) {
setJavaVersion(it, 17)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ configurations.matching({ it.name.startsWith('test') }).each({
}
})

tasks.named("compileLatestDepTestJava") {
tasks.named("compileLatestDepTestJava", JavaCompile) {
setJavaVersion(it, 17)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@ apply from: "$rootDir/gradle/java.gradle"
addTestSuiteForDir('latestDepTest', 'test')
addTestSuiteExtendingForDir('latestDepForkedTest', 'latestDepTest', 'test')

[compileMain_java17Java, compileTestJava, compileLatestDepTestJava].each {
it.configure {
["compileMain_java17Java", "compileTestJava", "compileLatestDepTestJava"].each { name ->
tasks.named(name, JavaCompile) {
setJavaVersion(it, 17)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

tasks.withType(JavaCompile).each {
it.configure {
setJavaVersion(it, 17)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

tasks.withType(GroovyCompile) {
javaLauncher = getJavaLauncherFor(17)
}
Expand Down
2 changes: 1 addition & 1 deletion dd-java-agent/instrumentation/karate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sourceSets {
}
}

tasks.named("compileLatestDepTestJava") {
tasks.named("compileLatestDepTestJava", JavaCompile) {
setJavaVersion(it, 11)
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ apply from: "$rootDir/gradle/test-with-kotlin.gradle"

addTestSuite('latestDepTest')

tasks.named("compileTestFixturesGroovy") {
tasks.named("compileTestFixturesGroovy", GroovyCompile) {
classpath += files(compileTestFixturesKotlin.destinationDirectory)
}

tasks.named("compileTestGroovy") {
tasks.named("compileTestGroovy", GroovyCompile) {
classpath += files(compileTestKotlin.destinationDirectory)
}

tasks.named("compileLatestDepTestGroovy") {
tasks.named("compileLatestDepTestGroovy", GroovyCompile) {
classpath += files(compileLatestDepTestKotlin.destinationDirectory)
}

Expand Down
Loading