-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
72 lines (64 loc) · 2.16 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
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
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<KotlinCompilationTask<*>>().configureEach {
compilerOptions {
// Treat all Kotlin warnings as errors
allWarningsAsErrors.set(true)
// Enable experimental coroutines APIs, including Flow
freeCompilerArgs.addAll(
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-opt-in=kotlinx.coroutines.FlowPreview",
)
}
}
rootProject.plugins.withType<YarnPlugin>().configureEach {
rootProject.the<YarnRootExtension>().yarnLockMismatchReport =
YarnLockMismatchReport.WARNING // NONE | FAIL
rootProject.the<YarnRootExtension>().reportNewYarnLock = false // true
rootProject.the<YarnRootExtension>().yarnLockAutoReplace = false // true
}
}