-
Notifications
You must be signed in to change notification settings - Fork 333
Expand file tree
/
Copy pathbuild.gradle
More file actions
60 lines (54 loc) · 1.77 KB
/
build.gradle
File metadata and controls
60 lines (54 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
ext {
minJavaVersionForTests = JavaVersion.VERSION_21
// Structured concurrency is a preview feature in Java 21. Methods (e.g. ShutdownOnFailure) used in this instrumentation test are no longer available in Java 25, so we set the max version to 24.
// See: https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/StructuredTaskScope.html
maxJavaVersionForTests = JavaVersion.VERSION_24
}
apply from: "$rootDir/gradle/java.gradle"
// Use slf4j-simple as default; logback has a high chance of getting stuck in a deadlock on CI.
apply from: "$rootDir/gradle/slf4j-simple.gradle"
apply plugin: 'idea'
muzzle {
pass {
coreJdk('21')
}
}
idea {
module {
jdkName = '21'
}
}
/*
* Declare previewTest, a test suite that requires the Javac/Java --enable-preview feature flag
*/
addTestSuite('previewTest')
// Configure groovy test file compilation
compilePreviewTestGroovy.configure {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
}
options.compilerArgs.add("--enable-preview")
}
// Configure Java test files compilation
compilePreviewTestJava.configure {
options.compilerArgs.add("--enable-preview")
}
// Configure tests execution
previewTest.configure {
jvmArgs = ['--enable-preview']
}
// Require the preview test suite to run as part of module check
tasks.named("check") {
dependsOn "previewTest"
}
dependencies {
testImplementation project(':dd-java-agent:instrumentation:trace-annotation')
}
// Set all compile tasks to use JDK21 but let instrumentation code targets 1.8 compatibility
project.tasks.withType(AbstractCompile).configureEach {
setJavaVersion(it, 21)
}
compileJava.configure {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}