Simplify Jacoco configuration
MODIFY
dd-java-agent/agent-bootstrap/agent-bootstrap.gradle
dd-java-agent/agent-bootstrap/agent-bootstrap.gradle
@@ -5,9 +5,7 @@ plugins {
apply from: "${rootDir}/gradle/java.gradle"
-whitelistedInstructionClasses = whitelistedBranchClasses += [
- 'datadog.trace.bootstrap.*'
-]
+excludedClassesConverage += [ 'datadog.trace.bootstrap.*' ]
dependencies {
compile project(':dd-trace-api')

MODIFY
dd-java-agent/agent-tooling/agent-tooling.gradle
dd-java-agent/agent-tooling/agent-tooling.gradle
apply from: "${rootDir}/gradle/java.gradle"
-whitelistedInstructionClasses = whitelistedBranchClasses += [
- 'datadog.trace.agent.tooling.*'
-]
+excludedClassesConverage += [ 'datadog.trace.agent.tooling.*' ]
configurations {
// classpath used by the instrumentation muzzle plugin

MODIFY
dd-java-agent/instrumentation/instrumentation.gradle
dd-java-agent/instrumentation/instrumentation.gradle
@@ -39,9 +39,7 @@ subprojects { subProj ->
}
}
-whitelistedInstructionClasses = whitelistedBranchClasses += [
- 'datadog.trace.instrumentation.*'
-]
+excludedClassesConverage += [ 'datadog.trace.instrumentation.*' ]
dependencies {
compile(project(':dd-java-agent:agent-tooling')) {

MODIFY
dd-java-agent/instrumentation/java-concurrent/akka-testing/akka-testing.gradle
dd-java-agent/instrumentation/java-concurrent/akka-testing/akka-testing.gradle
apply from: "${rootDir}/gradle/java.gradle"
apply plugin: 'scala'
-whitelistedInstructionClasses = whitelistedBranchClasses += [
- '*'
-]
+excludedClassesConverage += [ '*' ]
dependencies {
compile project(':dd-trace-api')

MODIFY
dd-java-agent/testing/testing.gradle
dd-java-agent/testing/testing.gradle
@@ -2,7 +2,7 @@ apply from: "${rootDir}/gradle/java.gradle"
minimumBranchCoverage = 0.5
minimumInstructionCoverage = 0.6
-whitelistedInstructionClasses = whitelistedBranchClasses += [
+excludedClassesConverage += [
'datadog.trace.agent.test.*Assert',
'datadog.trace.agent.test.AgentTestRunner.ErrorCountingListener',
'datadog.trace.agent.test.TestUtils'

MODIFY
dd-trace-ot/dd-trace-ot.gradle
dd-trace-ot/dd-trace-ot.gradle
@@ -9,7 +9,7 @@ apply from: "${rootDir}/gradle/publish.gradle"
minimumBranchCoverage = 0.5
minimumInstructionCoverage = 0.6
-whitelistedInstructionClasses = whitelistedBranchClasses += [
+excludedClassesConverage += [
'datadog.trace.common.writer.ListWriter',
'datadog.trace.common.sampling.PrioritySampling'
]

MODIFY
gradle/jacoco.gradle
gradle/jacoco.gradle
@@ -13,16 +13,22 @@ jacocoTestReport {
}
}
-if (project.parent.hasProperty("whitelistedBranchClasses")) {
- project.ext.whitelistedBranchClasses = parent.whitelistedBranchClasses
+if (project.parent.hasProperty("excludedClassesConverage")) {
+ project.ext.excludedClassesConverage = parent.excludedClassesConverage
} else {
- project.ext.whitelistedBranchClasses = []
+ project.ext.excludedClassesConverage = []
}
-if (project.parent.hasProperty("whitelistedInstructionClasses")) {
- project.ext.whitelistedInstructionClasses = parent.whitelistedInstructionClasses
+if (project.parent.hasProperty("excludedClassesBranchConverage")) {
+ project.ext.excludedClassesBranchConverage = parent.excludedClassesBranchConverage
} else {
- project.ext.whitelistedInstructionClasses = []
+ project.ext.excludedClassesBranchConverage = []
+}
+
+if (project.parent.hasProperty("excludedClassesInstructionConverage")) {
+ project.ext.excludedClassesInstructionConverage = parent.excludedClassesInstructionConverage
+} else {
+ project.ext.excludedClassesInstructionConverage = []
}
// defaults can be overridden per project:
@@ -34,7 +40,7 @@ afterEvaluate {
violationRules {
rule {
element = 'CLASS'
- excludes = project.whitelistedBranchClasses
+ excludes = project.excludedClassesBranchConverage + project.excludedClassesConverage
limit {
counter = 'BRANCH'
minimum = project.minimumBranchCoverage
@@ -43,7 +49,7 @@ afterEvaluate {
rule {
element = 'CLASS'
- excludes = project.whitelistedInstructionClasses
+ excludes = project.excludedClassesInstructionConverage + project.excludedClassesConverage
limit {
counter = 'INSTRUCTION'
minimum = project.minimumInstructionCoverage

Simplify Jacoco configuration