-
Notifications
You must be signed in to change notification settings - Fork 347
Expand file tree
/
Copy pathbuild.gradle
More file actions
106 lines (91 loc) · 2.94 KB
/
Copy pathbuild.gradle
File metadata and controls
106 lines (91 loc) · 2.94 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
plugins {
id 'me.champeau.jmh'
id 'java-test-fixtures'
}
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/tries.gradle"
minimumBranchCoverage = 0.6
excludedClassesCoverage += ['datadog.trace.agent.tooling.*']
sourceSets {
register("test_java11") {
java {
srcDirs = [file('src/test/java11')]
}
}
register("test_java21") {
java {
srcDirs = [file('src/test/java21')]
}
}
named("test") {
compileClasspath += sourceSets.test_java11.output
runtimeClasspath += sourceSets.test_java11.output
compileClasspath += sourceSets.test_java21.output
runtimeClasspath += sourceSets.test_java21.output
}
}
configurations {
consumable("buildTimeInstrumentationToolingPlugins") {
extendsFrom runtimeElements
}
named("test_java11Implementation") {
extendsFrom testImplementation
}
}
dependencies {
api(project(':dd-java-agent:agent-bootstrap')) {
exclude group: 'com.datadoghq', module: 'agent-logging'
}
api group: 'com.blogspot.mydailyjava', name: 'weak-lock-free', version: '0.17'
api libs.asm
api libs.bytebuddy
api libs.bytebuddyagent
testImplementation project(':dd-java-agent:testing')
testImplementation libs.bytebuddy
testImplementation libs.bundles.junit5
testImplementation group: 'com.google.guava', name: 'guava-testlib', version: '20.0'
jmhImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.3.5.RELEASE'
}
jmh {
jmhVersion = libs.versions.jmh.get()
includeTests = true
}
tasks.named("compileJava") { dependsOn 'generateClassNameTries' }
tasks.named("sourcesJar") { dependsOn 'generateClassNameTries' }
tasks.named("compileJmhJava") { dependsOn tasks.named("compileTestJava") }
tasks.named("forbiddenApisJmh") {
ignoreFailures = true
}
tasks.named("compileTestJava") {
dependsOn('generateTestClassNameTries')
}
tasks.named("compileTestGroovy") {
configureCompiler(it,
8,
JavaVersion.VERSION_1_8,
"Groovy generates synthetic accessors methods from superclass, we don't want that for `URLClassLoader`," +
" otherwise anonymous class has one `loadClass` accessor's signature has `java.lang.Module`"
)
}
tasks.named("compileTest_java11Java") {
configureCompiler(it, 11, JavaVersion.VERSION_11)
}
tasks.named("compileTest_java21Java") {
configureCompiler(
it,
21,
JavaVersion.VERSION_1_8,
"This source set is specifically designed to make `javac` from a JDK post 18/19, generates " +
"bytecode that emit `invokeinterface` for `java.lang.Object` methods on an interface type. " +
"See https://bugs.openjdk.org/browse/JDK-8272715."
)
}
tasks.named("jmh") {
dependsOn(tasks.named("compileTestJava"))
outputs.upToDateWhen { false }
}
tasks.withType(Test).configureEach {
// same setting as AgentInstaller to avoid spurious agent-tooling test failures
// caused by ConfigTransformSpockExtension installing byte-buddy during testing
jvmArgs += ["-Dnet.bytebuddy.raw=true"]
}