-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
59 lines (50 loc) · 1.43 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
plugins {
alias(libs.plugins.detekt)
kotlin("jvm") version libs.versions.kotlin
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
repositories {
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
configurations.all {
resolutionStrategy {
failOnNonReproducibleResolution()
}
}
afterEvaluate {
configureKotlin()
configureDetekt()
}
}
fun Project.configureDetekt() {
detekt {
config.from(rootProject.files("detekt-config.yml"))
}
dependencies {
detektPlugins(libs.detekt.formatting)
detektPlugins(libs.twitter.compose.rules)
}
}
fun Project.configureKotlin() {
kotlin {
compilerOptions {
allWarningsAsErrors = true
// enable Compose compiler metrics and reports:
// https://github.com/androidx/androidx/blob/androidx-main/compose/compiler/design/compiler-metrics.md
val composeCompilerReportsDir = layout.buildDirectory.dir("compose").get()
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$composeCompilerReportsDir"
)
freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$composeCompilerReportsDir"
)
}
}
}