-
Notifications
You must be signed in to change notification settings - Fork 29
/
build.gradle.kts
101 lines (89 loc) · 3.03 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
repositories {
mavenCentral()
}
plugins {
id("org.sonarqube")
id("org.jlleitschuh.gradle.ktlint")
id("io.gitlab.arturbosch.detekt")
id("it.nicolasfarabegoli.conventional-commits") version "3.1.0"
}
subprojects {
// skip auto generated modules
val autoGeneratedModules = listOf("foundation-icons", "foundation-assets")
if (autoGeneratedModules.contains(project.name)) return@subprojects
apply {
plugin("org.sonarqube")
plugin("org.jlleitschuh.gradle.ktlint")
plugin("io.gitlab.arturbosch.detekt")
}
val reportMerge by tasks.registering(io.gitlab.arturbosch.detekt.report.ReportMergeTask::class) {
output.set(rootProject.buildDir.resolve("reports/detekt/merge.xml"))
}
plugins.withType(io.gitlab.arturbosch.detekt.DetektPlugin::class) {
tasks.withType(io.gitlab.arturbosch.detekt.Detekt::class) detekt@{
finalizedBy(reportMerge)
reportMerge.configure {
input.from(this@detekt.xmlReportFile)
}
}
}
sonarqube {
properties {
property("sonar.sources", "src/main")
property("sonar.debug", true)
}
}
ktlint {
debug.set(false)
version.set("0.42.1")
verbose.set(true)
android.set(false)
outputToConsole.set(true)
ignoreFailures.set(false)
enableExperimentalRules.set(true)
disabledRules.set(arrayListOf("experimental:argument-list-wrapping"))
filter {
exclude("**/generated/**")
include("**/kotlin/**")
}
}
tasks {
withType(io.gitlab.arturbosch.detekt.Detekt::class.java) {
config.setFrom(rootProject.files("config/detekt/detekt.yml"))
reports {
html {
required.set(true)
outputLocation.set(file("build/reports/detekt.html"))
}
xml {
required.set(true)
outputLocation.set(file("build/reports/detekt.xml"))
}
}
}
}
}
apply {
plugin("org.sonarqube")
}
sonarqube {
properties {
property("sonar.projectKey", "Decathlon_vitamin-compose")
property("sonar.projectName", "vitamin-compose")
property("sonar.organization", "decathlon")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.kotlin.detekt.reportPaths", "$buildDir/reports/detekt/merge.xml")
property("sonar.login", System.getenv("SONAR_TOKEN"))
}
}
conventionalCommits {
scopes = subprojects.map { module -> module.name }.toList()
failureMessage = "Error : The commit message does not meet the Conventional Commit standard\n" +
"An example of a valid message is:\n" +
"feat(buttons): add the small size button\n" +
"Available scopes : ${scopes}\n" +
"More details at: https://www.conventionalcommits.org/en/v1.0.0/#summary"
}
tasks.create<Delete>("clean") {
delete(rootProject.buildDir)
}