Skip to content

Commit

Permalink
Add test tasks as dependencies to test report. (#3736)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga authored Oct 13, 2021
1 parent 8f426fb commit f99d5dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions all/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ tasks {
}
}

val testTasks = mutableListOf<Task>()

dependencies {
rootProject.subprojects.forEach { subproject ->
// Generate aggregate coverage report for published modules that enable jacoco.
Expand All @@ -30,6 +32,9 @@ dependencies {
implementation(project(subproject.path)) {
isTransitive = false
}
subproject.tasks.withType<Test>().configureEach {
testTasks.add(this)
}
}
}
}
Expand Down Expand Up @@ -65,6 +70,8 @@ val coverageDataPath by configurations.creating {
tasks.named<JacocoReport>("jacocoTestReport") {
enabled = true

dependsOn(testTasks)

configurations.runtimeClasspath.get().forEach {
additionalClassDirs(
zipTree(it).filter {
Expand Down

0 comments on commit f99d5dc

Please sign in to comment.