Skip to content

Commit d837e39

Browse files
authored
Include Android compilations in aggregation
PR #655
1 parent 82a65bc commit d837e39

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

kover-gradle-plugin/src/main/kotlin/kotlinx/kover/gradle/aggregation/commons/names/PluginId.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ package kotlinx.kover.gradle.aggregation.commons.names
66

77
internal object PluginId {
88
const val KOTLIN_JVM_PLUGIN_ID = "org.jetbrains.kotlin.jvm"
9+
const val KOTLIN_ANDROID_PLUGIN_ID = "org.jetbrains.kotlin.android"
910
const val KOTLIN_MULTIPLATFORM_PLUGIN_ID = "org.jetbrains.kotlin.multiplatform"
1011
}

kover-gradle-plugin/src/main/kotlin/kotlinx/kover/gradle/aggregation/project/KoverProjectGradlePlugin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ internal class KoverProjectGradlePlugin : Plugin<Project> {
7878

7979
val compilations = project.layout.buildDirectory.map {
8080
val compilations = when {
81-
pluginManager.hasPlugin(KOTLIN_JVM_PLUGIN_ID) -> {
81+
pluginManager.hasPlugin(KOTLIN_JVM_PLUGIN_ID) || pluginManager.hasPlugin(KOTLIN_ANDROID_PLUGIN_ID) -> {
8282
val kotlin = exts.findByName("kotlin")?.bean()
8383
?: throw KoverCriticalException("Kotlin JVM extension not found")
8484
kotlin["target"]["compilations"].sequence()
@@ -100,7 +100,7 @@ internal class KoverProjectGradlePlugin : Plugin<Project> {
100100

101101
compilations.filter { compilation ->
102102
val compilationName = compilation["name"].value<String>()
103-
if (compilationName == "test") return@filter false
103+
if (compilationName == "test" || compilationName.endsWith("Test")) return@filter false
104104

105105
val taskPath = projectPath + (if (projectPath == Project.PATH_SEPARATOR) "" else Project.PATH_SEPARATOR) + compilation["compileTaskProvider"]["name"].value<String>()
106106
taskGraph.hasTask(taskPath)

0 commit comments

Comments
 (0)