Skip to content

Commit

Permalink
Merge pull request #1542 from robstoll/codecov
Browse files Browse the repository at this point in the history
update tutteli-gradle-plugin to v4.10.2, remove coverage workaround
  • Loading branch information
robstoll authored Sep 21, 2023
2 parents 08ecd59 + 99b0d04 commit e1675fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
6 changes: 3 additions & 3 deletions gradle/build-logic/dev/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -15,33 +14,23 @@ dependencies {
}

val jacocoToolVersion: String by rootProject.extra

plugins.withId("jacoco") {
configure<JacocoPluginExtension> {
if (rootProject.name != "gradle-kotlin-dsl-accessors") {
toolVersion = jacocoToolVersion
}
}
//
val jacocoAdditionalExtraName = "jacocoAdditional"

tasks.withType<JacocoReport>()
.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<Project>
junitjacoco {
additionalProjectSources.set(additional)
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/build-logic/publishing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
2 changes: 1 addition & 1 deletion gradle/build-logic/root-build/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

0 comments on commit e1675fb

Please sign in to comment.