summaryrefslogtreecommitdiff
path: root/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-18 15:51:13 +0200
committerGitHub <noreply@github.com>2021-05-18 15:51:13 +0200
commit02776c958a3254735b2be7d9fb1627f75e7f80cd (patch)
tree155d96b0f1a5173e4ac884ac6c9cbccea011918f /buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts
parent1ce710ebaa8b071a3b30447d431f4af422f25156 (diff)
parent7cbb401a0939cc58daae8b481a97f4b05140ec3b (diff)
build: Add support for Java 16
This pull request adds support for building OpenDC using Java 16. To make this possible, we have upgraded the following dependencies: - Kotlin from 1.4.3 to 1.5.0 - Jacoco from 0.8.6 to 0.8.7 - Gradle from 7.0 to 7.0.2
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!!
- })
-}