From 99b0d04f34e7ca0d8f590822b02662d80d61c09c Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Thu, 21 Sep 2023 22:45:49 +0200 Subject: [PATCH] update tutteli-gradle-plugin to v4.10.2, remove coverage workaround --- gradle/build-logic/dev/build.gradle.kts | 6 ++--- ...-logic.junit-jacoco-conventions.gradle.kts | 23 +++++-------------- .../build-logic/publishing/build.gradle.kts | 4 ++-- .../build-logic/root-build/build.gradle.kts | 2 +- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/gradle/build-logic/dev/build.gradle.kts b/gradle/build-logic/dev/build.gradle.kts index f94fb461f6..f1baa99a9c 100644 --- a/gradle/build-logic/dev/build.gradle.kts +++ b/gradle/build-logic/dev/build.gradle.kts @@ -9,7 +9,7 @@ dependencies { api("org.jetbrains.dokka:dokka-base:1.9.0") api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22") - api("ch.tutteli.gradle.plugins.junitjacoco:ch.tutteli.gradle.plugins.junitjacoco.gradle.plugin:4.10.0") - api("ch.tutteli.gradle.plugins.kotlin.module.info:ch.tutteli.gradle.plugins.kotlin.module.info.gradle.plugin:4.10.0") - api("ch.tutteli.gradle.plugins.spek:ch.tutteli.gradle.plugins.spek.gradle.plugin:4.10.0") + api("ch.tutteli.gradle.plugins.junitjacoco:ch.tutteli.gradle.plugins.junitjacoco.gradle.plugin:4.10.2") + api("ch.tutteli.gradle.plugins.kotlin.module.info:ch.tutteli.gradle.plugins.kotlin.module.info.gradle.plugin:4.10.2") + api("ch.tutteli.gradle.plugins.spek:ch.tutteli.gradle.plugins.spek.gradle.plugin:4.10.2") } diff --git a/gradle/build-logic/dev/src/main/kotlin/build-logic.junit-jacoco-conventions.gradle.kts b/gradle/build-logic/dev/src/main/kotlin/build-logic.junit-jacoco-conventions.gradle.kts index 2c79b3ece3..d1f08e30d8 100644 --- a/gradle/build-logic/dev/src/main/kotlin/build-logic.junit-jacoco-conventions.gradle.kts +++ b/gradle/build-logic/dev/src/main/kotlin/build-logic.junit-jacoco-conventions.gradle.kts @@ -1,6 +1,5 @@ import org.gradle.api.Project import org.gradle.kotlin.dsl.extra -import org.gradle.kotlin.dsl.findByType import org.gradle.testing.jacoco.plugins.JacocoPluginExtension import org.gradle.testing.jacoco.tasks.JacocoReport @@ -15,33 +14,23 @@ dependencies { } val jacocoToolVersion: String by rootProject.extra - plugins.withId("jacoco") { configure { if (rootProject.name != "gradle-kotlin-dsl-accessors") { toolVersion = jacocoToolVersion } } -// - val jacocoAdditionalExtraName = "jacocoAdditional" + tasks.withType() .matching { it.name == "jacocoTestReport" } .configureEach { - val coverageSourceDirs = arrayOf( - "src/commonMain", - "src/jvmMain" - ) - //TODO 1.2.0 remove again, should be fixed in tutteli-gradle-plugins by now - sourceDirectories.from(project.files(coverageSourceDirs)) - classDirectories.from(project.layout.buildDirectory.map { it.dir("classes/kotlin/jvm/main").asFileTree }) - //TODO 1.2.0 translate to convention-plugin (or add to tutteli-plugin directly) + val jacocoAdditionalExtraName = "jacocoAdditional" if (project.extra.has(jacocoAdditionalExtraName)) { - val additional = project.extra.get(jacocoAdditionalExtraName) as List<*> - additional.forEach { p -> - val otherProject = p as Project - sourceDirectories.from(otherProject.files(coverageSourceDirs)) - classDirectories.from(otherProject.layout.buildDirectory.map { it.dir("classes/kotlin/jvm/main").asFileTree }) + @Suppress("UNCHECKED_CAST") + val additional = project.extra.get(jacocoAdditionalExtraName) as List + junitjacoco { + additionalProjectSources.set(additional) } } diff --git a/gradle/build-logic/publishing/build.gradle.kts b/gradle/build-logic/publishing/build.gradle.kts index 12bbd3ed12..451abca693 100644 --- a/gradle/build-logic/publishing/build.gradle.kts +++ b/gradle/build-logic/publishing/build.gradle.kts @@ -9,6 +9,6 @@ dependencies { api("org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin:1.9.0") api("org.jetbrains.dokka:dokka-base:1.9.0") - api("ch.tutteli.gradle.plugins.dokka:ch.tutteli.gradle.plugins.dokka.gradle.plugin:4.10.0") - api("ch.tutteli.gradle.plugins.publish:ch.tutteli.gradle.plugins.publish.gradle.plugin:4.10.0") + api("ch.tutteli.gradle.plugins.dokka:ch.tutteli.gradle.plugins.dokka.gradle.plugin:4.10.2") + api("ch.tutteli.gradle.plugins.publish:ch.tutteli.gradle.plugins.publish.gradle.plugin:4.10.2") } diff --git a/gradle/build-logic/root-build/build.gradle.kts b/gradle/build-logic/root-build/build.gradle.kts index 16ee8ef9d6..9fbda5553b 100644 --- a/gradle/build-logic/root-build/build.gradle.kts +++ b/gradle/build-logic/root-build/build.gradle.kts @@ -9,5 +9,5 @@ dependencies { api("org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin:1.9.0") api("org.jetbrains.dokka:dokka-base:1.9.0") - api("ch.tutteli.gradle.plugins.dokka:ch.tutteli.gradle.plugins.dokka.gradle.plugin:4.10.0") + api("ch.tutteli.gradle.plugins.dokka:ch.tutteli.gradle.plugins.dokka.gradle.plugin:4.10.2") }