Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 52 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import kotlinx.kover.gradle.plugin.dsl.CoverageUnit

plugins {
alias(libs.plugins.jetbrains.kotlin.multiplatform) apply false
alias(libs.plugins.jetbrains.kotlin.jvm) apply false
Expand All @@ -38,15 +40,21 @@ plugins {
alias(libs.plugins.kover)
}

val koverProjects = listOf(
projects.tasksAppShared,
projects.tasksCore,
projects.google.tasks,
)

dependencies {
kover(projects.tasksAppShared)
kover(projects.tasksCore)
kover(projects.google.tasks)
koverProjects.onEach { koverProject ->
kover(koverProject)
}
}

kover {
currentProject {
createVariant("custom") {}
createVariant("coverage") {}
}

reports {
Expand All @@ -61,7 +69,18 @@ kover {
"net.opatry.tasks.app.auth.*",
"net.opatry.tasks.app.di.*",
"net.opatry.tasks.app.presentation.model.*",
"net.opatry.tasks.app.ui.*",
"net.opatry.tasks.app.ui.AppTasksScreen*",
"net.opatry.tasks.app.ui.Singletons*",
"net.opatry.tasks.app.ui.ComposableSingletons*",
"net.opatry.tasks.app.ui.TaskEvent*",
"net.opatry.tasks.app.ui.TasksApp*",
"net.opatry.tasks.app.ui.*PreviewKt*",
"net.opatry.tasks.app.ui.*PreviewParameterProvider*",
"net.opatry.tasks.app.ui.*PreviewDataProvider*",
"net.opatry.tasks.app.ui.component.ComposableSingletons*",
"net.opatry.tasks.app.ui.component.AuthorizeGoogleTasksButton*",
"net.opatry.tasks.app.ui.component.BackHandler*",
"net.opatry.tasks.app.ui.component.EmptyStateParam*",
"net.opatry.tasks.app.ui.icon.*",
"net.opatry.tasks.app.ui.screen.*",
"net.opatry.tasks.app.ui.theme.*",
Expand All @@ -74,9 +93,34 @@ kover {
}
}

verify.rule {
bound {
minValue = 85
verify {
rule("Instruction coverage") {
minBound(
minValue = 80,
coverageUnits = CoverageUnit.INSTRUCTION
)
}
rule("Line coverage") {
minBound(
minValue = 85,
coverageUnits = CoverageUnit.LINE
)
}
}
}
}

subprojects {
if (project.name in koverProjects.map { it.name }) {
project.afterEvaluate {
apply(plugin = libs.plugins.kover.get().pluginId)
kover {
currentProject {
createVariant("coverage") {
add("jvm")
addWithDependencies("debug", optional = true)
}
}
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions google/tasks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
plugins {
alias(libs.plugins.jetbrains.kotlin.multiplatform)
alias(libs.plugins.jetbrains.kotlin.serialization)
alias(libs.plugins.kover)
}

kotlin {
Expand All @@ -41,12 +40,4 @@ kotlin {
implementation(libs.kotlinx.coroutines.test)
}
}
}

kover {
currentProject {
createVariant("custom") {
add("jvm")
}
}
}
10 changes: 0 additions & 10 deletions tasks-app-shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ plugins {
alias(libs.plugins.compose.hot.reload)
alias(libs.plugins.androidx.room)
alias(libs.plugins.android.library)
alias(libs.plugins.kover)
}

compose.resources {
Expand Down Expand Up @@ -160,13 +159,4 @@ android {
}
}
}
}

kover {
currentProject {
createVariant("custom") {
add("jvm")
addWithDependencies("debug")
}
}
}
9 changes: 0 additions & 9 deletions tasks-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
plugins {
alias(libs.plugins.jetbrains.kotlin.multiplatform)
alias(libs.plugins.jetbrains.kotlin.serialization)
alias(libs.plugins.kover)
}

kotlin {
Expand All @@ -48,12 +47,4 @@ kotlin {
implementation(kotlin("test"))
}
}
}

kover {
currentProject {
createVariant("custom") {
add("jvm")
}
}
}