Skip to content

Commit

Permalink
Add jacoco
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonBailey committed Jul 1, 2024
1 parent 71c4593 commit 21c0d2c
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("dev.jacksonbailey.wheel.base-common-conventions")
jacoco
java
}

Expand All @@ -11,16 +12,29 @@ java {
withSourcesJar()
}

jacoco {
toolVersion = "0.8.12" // https://www.jacoco.org/jacoco/
}

tasks {
withType<JavaCompile> {
// TODO Check that -g is actually adding debug info because it seems like it's already there
options.compilerArgs.addAll(listOf("-Xlint:all", "-g"))
}

named<Test>("test") {
test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}

jacocoTestReport {
dependsOn(tasks.test)
}

/*
* Using jar { } will only apply to tasks named "jar" so the license would not end up in the
* javadoc jar nor source jar.
*/
withType<Jar> {
metaInf {
from(layout.projectDirectory.file("LICENSE"))
Expand Down

0 comments on commit 21c0d2c

Please sign in to comment.