Skip to content

Commit

Permalink
root: Centralize Kover configuration
Browse files Browse the repository at this point in the history
This commit centralizes the Kover configuration in the root
`build.gradle.kts` file and applies it to all subprojects.
  • Loading branch information
MrHadiSatrio committed Jul 27, 2024
1 parent c27de21 commit 5e867f7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 138 deletions.
23 changes: 0 additions & 23 deletions app-kmm-journal3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,3 @@ android {
targetSdk = 33
}
}

koverReport {
filters {
excludes {
classes("*Fake*", "*Test")
}
}
defaults {
verify {
onCheck = true
rule("Branch coverage must exceed 90%") {
isEnabled = true
entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION

bound {
minValue = 90
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.BRANCH
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
}
}
}
}
}
28 changes: 28 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import kotlinx.kover.gradle.plugin.dsl.AggregationType
import kotlinx.kover.gradle.plugin.dsl.GroupingEntityType
import kotlinx.kover.gradle.plugin.dsl.KoverReportExtension
import kotlinx.kover.gradle.plugin.dsl.MetricType

plugins {
//trick: for the same plugin versions in all sub-modules
Expand Down Expand Up @@ -40,6 +44,30 @@ subprojects {
dependencies {
add("detektPlugins", libs.detekt.formatting)
}

apply(plugin = libs.plugins.kover.get().pluginId)
extensions.configure<KoverReportExtension> {
filters {
excludes {
classes("*Fake*", "*Test")
}
}
defaults {
verify {
onCheck = true
rule("Branch coverage must exceed 90%") {
isEnabled = true
entity = GroupingEntityType.APPLICATION

bound {
minValue = 90
metric = MetricType.BRANCH
aggregation = AggregationType.COVERED_PERCENTAGE
}
}
}
}
}
}

sonarqube {
Expand Down
23 changes: 0 additions & 23 deletions lib-kmm-foundation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,3 @@ android {
}
}
}

koverReport {
filters {
excludes {
classes("*Fake*", "*Test")
}
}
defaults {
verify {
onCheck = true
rule("Branch coverage must exceed 90%") {
isEnabled = true
entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION

bound {
minValue = 90
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.BRANCH
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
}
}
}
}
}
23 changes: 0 additions & 23 deletions lib-kmm-geography/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,3 @@ android {
}
}
}

koverReport {
filters {
excludes {
classes("*Fake*", "*Test")
}
}
defaults {
verify {
onCheck = true
rule("Branch coverage must exceed 90%") {
isEnabled = true
entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION

bound {
minValue = 90
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.BRANCH
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
}
}
}
}
}
23 changes: 0 additions & 23 deletions lib-kmm-io/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,3 @@ android {
}
}
}

koverReport {
filters {
excludes {
classes("*Fake*", "*Test")
}
}
defaults {
verify {
onCheck = true
rule("Branch coverage must exceed 90%") {
isEnabled = true
entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION

bound {
minValue = 90
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.BRANCH
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
}
}
}
}
}
23 changes: 0 additions & 23 deletions lib-kmm-json/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,3 @@ android {
}
}
}

koverReport {
filters {
excludes {
classes("*Fake*", "*Test")
}
}
defaults {
verify {
onCheck = true
rule("Branch coverage must exceed 90%") {
isEnabled = true
entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION

bound {
minValue = 90
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.BRANCH
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
}
}
}
}
}
23 changes: 0 additions & 23 deletions lib-kmm-paraphrase/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,3 @@ android {
}
}
}

koverReport {
filters {
excludes {
classes("*Fake*", "*Test")
}
}
defaults {
verify {
onCheck = true
rule("Branch coverage must exceed 90%") {
isEnabled = true
entity = kotlinx.kover.gradle.plugin.dsl.GroupingEntityType.APPLICATION

bound {
minValue = 90
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.BRANCH
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
}
}
}
}
}

0 comments on commit 5e867f7

Please sign in to comment.