|
| 1 | +plugins { |
| 2 | + id "com.github.johnrengelman.shadow" |
| 3 | +} |
| 4 | + |
| 5 | +// Set properties before any plugins get loaded |
| 6 | +ext { |
| 7 | + enableJunitPlatform = true |
| 8 | + minJavaVersionForTests = JavaVersion.VERSION_1_8 |
| 9 | +} |
| 10 | + |
| 11 | +apply from: "$rootDir/gradle/java.gradle" |
| 12 | +// We do not publish separate jar, but having version file is useful |
| 13 | +apply from: "$rootDir/gradle/version.gradle" |
| 14 | + |
| 15 | +minimumInstructionCoverage = 0.1 |
| 16 | +minimumBranchCoverage = 0.6 |
| 17 | +excludedClassesCoverage += [ |
| 18 | + 'com.datadog.debugger.model.*Exception', |
| 19 | + 'com.datadog.debugger.parser.*Exception', |
| 20 | + 'com.datadog.debugger.agent.DebuggerTransformer.SafeClassWriter', |
| 21 | + 'com.datadog.debugger.agent.DebuggerProbe.When.Threshold', |
| 22 | + 'com.datadog.debugger.agent.DebuggerAgent.ShutdownHook', |
| 23 | + // too old for this coverage (JDK 1.2) |
| 24 | + 'antlr.*' |
| 25 | +] |
| 26 | + |
| 27 | +dependencies { |
| 28 | + // main dependencies |
| 29 | + implementation project(':utils:container-utils') |
| 30 | + implementation deps.slf4j |
| 31 | + implementation deps.asm |
| 32 | + implementation deps.asmcommons |
| 33 | + implementation project(':internal-api') |
| 34 | + implementation project(':communication') |
| 35 | + implementation project(':dd-java-agent:agent-tooling') |
| 36 | + implementation project(':dd-java-agent:agent-builder') |
| 37 | + implementation project(':dd-java-agent:agent-debugger:debugger-el') |
| 38 | + implementation project(':dd-java-agent:agent-debugger:debugger-bootstrap') |
| 39 | + implementation deps.okhttp |
| 40 | + implementation deps.dogstatsd |
| 41 | + |
| 42 | + testImplementation deps.junit5 |
| 43 | + testImplementation group: 'org.ow2.asm', name: 'asm-util', version: versions.asm |
| 44 | + testImplementation group: "org.junit.jupiter", name: "junit-jupiter-params", version: "${versions.junit5}" |
| 45 | + testImplementation project(':dd-java-agent:agent-debugger:debugger-test-scala') |
| 46 | + testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.7.0") |
| 47 | + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit5}") |
| 48 | + testImplementation deps.mockito |
| 49 | + testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: versions.okhttp |
| 50 | + testImplementation group: 'org.springframework.boot', name: 'spring-boot', version: '2.3.5.RELEASE' |
| 51 | + testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.3.5.RELEASE' |
| 52 | + testImplementation group: 'org.freemarker', name: 'freemarker', version: '2.3.30' |
| 53 | + testImplementation group: 'org.jooq', name: 'joor-java-8', version: '0.9.13' |
| 54 | + testImplementation group: 'org.jetbrains.kotlin', name: 'kotlin-compiler-embeddable', version: "1.5.21" |
| 55 | + testRuntimeOnly group: 'org.scala-lang', name: 'scala-compiler', version: '2.13.3' |
| 56 | + testRuntimeOnly group: 'antlr', name: 'antlr', version: '2.7.7' |
| 57 | +} |
| 58 | + |
| 59 | +sourceCompatibility = JavaVersion.VERSION_1_8 |
| 60 | +targetCompatibility = JavaVersion.VERSION_1_8 |
| 61 | + |
| 62 | +shadowJar { |
| 63 | + dependencies deps.sharedInverse |
| 64 | + dependencies { |
| 65 | + exclude(project(':dd-java-agent:agent-bootstrap')) |
| 66 | + exclude(project(':dd-java-agent:agent-debugger:debugger-bootstrap')) |
| 67 | + exclude(project(':dd-java-agent:agent-logging')) |
| 68 | + exclude(project(':dd-trace-api')) |
| 69 | + exclude(project(':internal-api')) |
| 70 | + exclude(project(':internal-api:internal-api-8')) |
| 71 | + exclude(project(':utils:socket-utils')) |
| 72 | + exclude(project(':utils:time-utils')) |
| 73 | + exclude(dependency('org.slf4j::')) |
| 74 | + } |
| 75 | +} |
| 76 | + |
| 77 | +jar { |
| 78 | + classifier = 'unbundled' |
| 79 | + from sourceSets.main.output |
| 80 | +} |
| 81 | + |
| 82 | +tasks.withType(Test).configureEach { |
| 83 | + options { |
| 84 | + // special property to skip some parametrized DebuggerTransformerTest tests |
| 85 | + // that generates a lot of tests |
| 86 | + systemProperty "fast-tests", project.findProperty("fast-tests") ?: "false" |
| 87 | + } |
| 88 | + // DebuggerTransformerTest made some Reflective calls on java.lang package |
| 89 | + // needs to open it since jdk16 |
| 90 | + def matcher = it.name =~ /testJava(\d+)Generated/ |
| 91 | + if (matcher) { |
| 92 | + def javaVersion = matcher.group(1) as int |
| 93 | + if (javaVersion >= 16) { |
| 94 | + jvmArgs '--add-opens', 'java.base/java.lang=ALL-UNNAMED' |
| 95 | + } |
| 96 | + } |
| 97 | +} |
0 commit comments