Skip to content

Commit c2ae8e7

Browse files
chore: add code coverage check (#2171)
1 parent d09cd16 commit c2ae8e7

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

DynamoDbEncryption/runtimes/java/build.gradle.kts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plugins {
1212
`maven-publish`
1313
`signing`
1414
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
15+
`jacoco`
1516
}
1617

1718
var props = Properties().apply {
@@ -229,6 +230,7 @@ tasks.test {
229230
}
230231
}
231232
})
233+
finalizedBy(tasks.jacocoTestCoverageVerification)
232234
}
233235

234236
tasks.register<JavaExec>("runTests") {
@@ -252,6 +254,24 @@ tasks.javadoc {
252254
exclude("src/main/dafny-generated")
253255
}
254256

257+
tasks.jacocoTestCoverageVerification {
258+
classDirectories.setFrom(
259+
fileTree("build/classes/java/main") {
260+
include("**/sdkv2/**")
261+
}
262+
)
263+
sourceDirectories.setFrom(
264+
files("src/main/sdkv2")
265+
)
266+
violationRules {
267+
rule {
268+
limit {
269+
minimum = "0.90".toBigDecimal()
270+
}
271+
}
272+
}
273+
}
274+
255275
nexusPublishing {
256276
// We are using the nexusPublishing plugin since it is recommended by Sonatype Gradle Project configurations
257277
// and it is easy to supply the creds we need to deploy

0 commit comments

Comments
 (0)