-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
62 lines (55 loc) · 1.7 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
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:${Versions.Essential.Gradle}")
classpath("com.diffplug.spotless:spotless-plugin-gradle:${Versions.CodeStyle.Spotless}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Essential.Kotlin}")
classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.Essential.Kotlin}")
classpath("com.google.dagger:hilt-android-gradle-plugin:${Versions.Di.Hilt}")
}
}
subprojects {
apply(plugin = "com.diffplug.spotless")
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
kotlin {
target("**/*.kt")
ktlint(Versions.CodeStyle.Ktlint).userData(
mapOf(
"disabled_rules" to "no-wildcard-imports",
)
)
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
kotlinGradle {
target("**/*.gradle.kts", "*.gradle.kts")
ktlint(Versions.CodeStyle.Ktlint)
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}
}
allprojects {
repositories {
google()
mavenCentral()
}
afterEvaluate {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf(
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.OptIn",
)
}
}
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}