-
Notifications
You must be signed in to change notification settings - Fork 23
/
build.gradle.kts
55 lines (49 loc) · 1.52 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
import com.diffplug.gradle.spotless.SpotlessExtension
plugins {
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.ben.manes.versions) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.maven.publish) apply false
}
buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
allprojects {
repositories {
google()
gradlePluginPortal()
mavenCentral()
mavenLocal()
}
apply(plugin = rootProject.libs.plugins.spotless.get().pluginId)
configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("$buildDir/**/*.kt")
targetExclude("bin/**/*.kt")
ktlint(libs.versions.ktlint.get())
}
kotlinGradle {
target("**/*.kts")
targetExclude("$buildDir/**/*.kts")
ktlint(libs.versions.ktlint.get())
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask<*>>().configureEach {
compilerOptions {
// Treat all Kotlin warnings as errors
allWarningsAsErrors.set(false)
// Enable experimental coroutines APIs, including Flow
freeCompilerArgs.addAll(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview"
)
}
}
}