-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
95 lines (82 loc) · 2.63 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
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.report.ReportMergeTask
plugins {
kotlin("jvm") version Version.KOTLIN
id("org.sonarqube") version Version.SONARQUBE
id("io.gitlab.arturbosch.detekt") version Version.DETEKT
id("org.jlleitschuh.gradle.ktlint") version Version.KTLINT apply(false)
}
group = "com.lukinhasssss.admin.catalogo"
repositories {
mavenCentral()
}
// Define version for plugins with vulnerabilities
configurations.all {
resolutionStrategy {
// failOnVersionConflict()
eachDependency {
if (requested.name == "kotlin-reflect") {
useVersion(Version.KOTLIN)
}
if (requested.name == "kotlin-stdlib-jdk7") {
useVersion(Version.KOTLIN)
}
}
}
}
// START OF DETEKT AND KTLINT CONFIGURATION
detekt {
toolVersion = Version.DETEKT
config.from(files("config/detekt/detekt.yml"))
buildUponDefaultConfig = true
}
tasks.withType<Detekt>().configureEach {
reports {
xml.required.set(true)
html.required.set(true)
txt.required.set(false)
sarif.required.set(false)
md.required.set(false)
}
}
val detektReportMerge by tasks.registering(ReportMergeTask::class) {
output.set(rootProject.layout.buildDirectory.file("reports/detekt/detekt-report.xml"))
}
subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
plugins.withType(DetektPlugin::class) {
tasks.withType(Detekt::class) detekt@{
finalizedBy(detektReportMerge)
detektReportMerge.configure {
input.from(this@detekt.xmlReportFile)
}
}
}
}
// END OF DETEKT AND KTLINT CONFIGURATION
// START OF SONAR MULTI-MODULE CONFIGURATION
sonar {
properties {
property("sonar.projectKey", "Lukinhasssss_admin-catalogo-de-videos-kotlin")
property("sonar.projectName", "admin-catalogo-de-videos-kotlin")
property("sonar.organization", "lukinhasssss")
property("sonar.host.url", "https://sonarcloud.io")
property(
"sonar.coverage.jacoco.xmlReportPaths",
"${projectDir.parentFile.path}/build/reports/jacoco/test/jacocoTestReport.xml"
)
property("sonar.exclusions", "build/generated/**/*")
}
}
subprojects {
sonar {
properties {
property(
"sonar.coverage.jacoco.xmlReportPaths",
"${projectDir.parentFile.path}/build/reports/jacoco/test/jacocoTestReport.xml"
)
}
}
}