@@ -43,7 +43,7 @@ plugins {
43
43
alias(libs.plugins.spotless) apply false
44
44
alias(libs.plugins.dokka)
45
45
alias(libs.plugins.node) apply false
46
- alias(libs.plugins.detekt) apply false
46
+ alias(libs.plugins.detekt)
47
47
alias(libs.plugins.kotlinx.kover)
48
48
}
49
49
@@ -82,7 +82,6 @@ subprojects {
82
82
val subproject = this
83
83
apply (plugin = " maven-publish" )
84
84
apply (plugin = " org.jetbrains.dokka" )
85
- apply (plugin = " io.gitlab.arturbosch.detekt" )
86
85
apply (plugin = " org.jetbrains.kotlinx.kover" )
87
86
88
87
version = rootProject.version
@@ -94,22 +93,6 @@ subprojects {
94
93
}
95
94
}
96
95
97
- tasks.withType<Detekt > {
98
- parallel = true
99
- // For now, we only use the results here as hints
100
- ignoreFailures = true
101
-
102
- buildUponDefaultConfig = true
103
- config.setFrom(parentProject.projectDir.resolve(" .detekt.yml" ))
104
-
105
- reports {
106
- sarif.required.set(true )
107
- // This is required for the GitHub upload action to easily find all sarif files in a single directory.
108
- sarif.outputLocation.set(parentProject.layout.buildDirectory.file(" reports/detekt/${project.name} .sarif" ))
109
- html.required.set(true )
110
- }
111
- }
112
-
113
96
val kotlinApiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion .KOTLIN_1_6
114
97
subproject.tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().configureEach {
115
98
if (! name.lowercase().contains(" test" )) {
@@ -168,6 +151,29 @@ subprojects {
168
151
download.set(true )
169
152
}
170
153
}
154
+
155
+ // Configure detekt including our custom rule sets
156
+ if (project.name != " detekt-rules" ) {
157
+ apply (plugin = " io.gitlab.arturbosch.detekt" )
158
+ dependencies {
159
+ detektPlugins(project(" :detekt-rules" ))
160
+ }
161
+ tasks.withType<Detekt > {
162
+ dependsOn(" :detekt-rules:assemble" )
163
+
164
+ parallel = true
165
+ // For now, we only use the results here as hints
166
+ ignoreFailures = true
167
+
168
+ buildUponDefaultConfig = true
169
+ config.setFrom(parentProject.projectDir.resolve(" .detekt.yml" ))
170
+
171
+ reports {
172
+ sarif.required.set(true )
173
+ html.required.set(true )
174
+ }
175
+ }
176
+ }
171
177
}
172
178
173
179
allprojects {
@@ -203,7 +209,8 @@ allprojects {
203
209
url = uri(" https://maven.pkg.github.com/modelix/modelix" )
204
210
credentials {
205
211
username = project.findProperty(" gpr.user" ) as ? String ? : System .getenv(" GITHUB_ACTOR" )
206
- password = project.findProperty(" gpr.universalkey" ) as ? String ? : System .getenv(" GHP_UNIVERSAL_TOKEN" )
212
+ password =
213
+ project.findProperty(" gpr.universalkey" ) as ? String ? : System .getenv(" GHP_UNIVERSAL_TOKEN" )
207
214
}
208
215
} else {
209
216
url = uri(" https://maven.pkg.github.com/modelix/modelix.core" )
0 commit comments