summaryrefslogtreecommitdiff
path: root/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-06 16:41:53 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-18 15:21:32 +0200
commit0f7e0bdbec732b23141f6bbe11b3b2299ca22813 (patch)
treeca8d6a7c949d68190b63b461da205fe4e6adf6e0 /buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts
parentcc9310efad6177909ff2f7415384d7c393383106 (diff)
build: Update Jacoco to version 0.8.7
This change updates the Gradle build configuration to use Jacoco 0.8.7, which is necessary for Kotlin 1.5.0 to work nicely with Jacoco.
Diffstat (limited to 'buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts')
-rw-r--r--buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts38
1 files changed, 5 insertions, 33 deletions
diff --git a/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts b/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts
index d0534d4f..5c7aea83 100644
--- a/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts
+++ b/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts
@@ -25,41 +25,13 @@ plugins {
jacoco
}
+jacoco {
+ // Necessary for Kotlin 1.5.0. See https://github.com/jacoco/jacoco/issues/1155
+ toolVersion = "0.8.7"
+}
+
tasks.jacocoTestReport {
reports {
html.isEnabled = true
}
}
-
-/* Share sources folder with other projects for aggregated JaCoCo reports */
-configurations.create("transitiveSourcesElements") {
- isVisible = false
- isCanBeResolved = false
- isCanBeConsumed = true
- extendsFrom(configurations.implementation.get())
- attributes {
- attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
- attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
- attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named("source-folders"))
- }
- sourceSets.main.get().java.srcDirs.forEach {
- outgoing.artifact(it)
- }
-}
-
-/* Share the coverage data to be aggregated for the whole product */
-configurations.create("coverageDataElements") {
- isVisible = false
- isCanBeResolved = false
- isCanBeConsumed = true
- extendsFrom(configurations.implementation.get())
- attributes {
- attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
- attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
- attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named("jacoco-coverage-data"))
- }
- // This will cause the test task to run if the coverage data is requested by the aggregation task
- outgoing.artifact(tasks.test.map { task ->
- task.extensions.getByType<JacocoTaskExtension>().destinationFile!!
- })
-}