-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
85 lines (77 loc) · 2.46 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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
alias(libs.plugins.androidApplication).apply(false)
alias(libs.plugins.androidLibrary).apply(false)
alias(libs.plugins.kotlinAndroid).apply(false)
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.plugins.kover).apply(false)
alias(libs.plugins.detekt).apply(false)
alias(libs.plugins.ruler).apply(false)
alias(libs.plugins.sonar)
}
allprojects {
configurations.all {
resolutionStrategy {
force("org.xerial:sqlite-jdbc:3.46.0.1")
}
}
}
subprojects {
val libs = rootProject.libs
apply(plugin = libs.plugins.detekt.get().pluginId)
extensions.configure<DetektExtension> {
autoCorrect = true
source.setFrom(
"src/main/kotlin",
"src/test/kotlin",
"src/commonMain/kotlin",
"src/commonTest/kotlin",
"src/androidMain/kotlin",
"src/androidUnitTest/kotlin",
"src/androidTest/kotlin",
"src/iosMain/kotlin",
"src/iosTest/kotlin"
)
}
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 {
properties {
property("sonar.projectKey", "MrHadiSatrio_Journal3")
property("sonar.organization", "mrhadisatrio")
property("sonar.host.url", "https://sonarcloud.io")
}
}
val clean by tasks.creating(Delete::class) {
delete(rootProject.buildDir)
delete("$rootDir/buildSrc/build")
}