-
Notifications
You must be signed in to change notification settings - Fork 344
Expand file tree
/
Copy pathbuild.gradle
More file actions
62 lines (53 loc) · 1.71 KB
/
Copy pathbuild.gradle
File metadata and controls
62 lines (53 loc) · 1.71 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
61
62
plugins {
id 'idea'
}
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"
testJvmConstraints {
minJavaVersion = JavaVersion.VERSION_21
}
muzzle {
pass {
coreJdk('21')
}
}
idea {
module {
jdkName = '21'
}
}
/*
* Declare previewTest, a test suite that requires the Javac/Java --enable-preview feature flag
*/
addTestSuite('previewTest')
tasks.named("previewTest").configure {
testJvmConstraints {
// 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
maxJavaVersion = JavaVersion.VERSION_24
}
}
// Set all compile tasks to use JDK21 but let instrumentation code targets 1.8 compatibility
tasks.withType(AbstractCompile).configureEach {
configureCompiler(it, 21, JavaVersion.VERSION_1_8)
}
// Configure groovy test file compilation
tasks.named("compilePreviewTestGroovy", GroovyCompile) {
options.compilerArgs.add("--enable-preview")
}
// Configure Java test files compilation
tasks.named("compilePreviewTestJava", JavaCompile) {
options.compilerArgs.add("--enable-preview")
}
// Configure tests execution
tasks.named("previewTest", Test) {
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:datadog:tracing:trace-annotation')
}