-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
97 lines (86 loc) · 3.24 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.kotlin.compose.compiler) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.dokka)
alias(libs.plugins.kover)
alias(libs.plugins.spotless)
}
allprojects {
buildTarget {
androidCompileSdk = providers.gradleProperty("androidCompileSdk").map { it.toInt() }
androidMinSdk = providers.gradleProperty("androidMinSdk").map { it.toInt() }
androidTargetSdk = providers.gradleProperty("androidTargetSdk").map { it.toInt() }
javaVersion = provider { JavaVersion.VERSION_11 }
composeCompilerDestination = layout.buildDirectory.dir("compose-compiler")
composeCompilerMetrics = providers.gradleProperty("composeCompilerMetrics").map { it.toBoolean() }
composeCompilerReports = providers.gradleProperty("composeCompilerReports").map { it.toBoolean() }
}
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
tasks.withType<KotlinCompilationTask<*>>().configureEach {
compilerOptions {
// Note: Kotlin 2.0.20 ~
// https://kotlinlang.org/docs/whatsnew2020.html#data-class-copy-function-to-have-the-same-visibility-as-constructor
freeCompilerArgs.add("-Xconsistent-data-class-copy-visibility")
}
}
apply(plugin = "com.diffplug.spotless")
configure<com.diffplug.gradle.spotless.SpotlessExtension> {
format("format") {
target("src/**/*.kt", "*.gradle.kts")
targetExclude("$projectDir/build/**/*.kt")
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
format("formatYaml") {
target(".github/**/*.yml")
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
if (project.path in publicModules) {
kotlin {
// ref. https://github.com/diffplug/spotless/tree/main/plugin-gradle#how-can-i-enforce-formatting-gradually-aka-ratchet
// ratchetFrom = "origin/main"
target("**/*.kt")
targetExclude("$projectDir/build/**/*.kt")
licenseHeaderFile(rootProject.file("spotless/copyright.txt"))
}
}
}
}
kover {
currentProject {
createVariant("soil") {
}
}
reports {
filters {
excludes {
androidGeneratedClasses()
}
}
}
}
dependencies {
kover(projects.soilQueryCore)
kover(projects.soilQueryCompose)
kover(projects.soilQueryComposeRuntime)
kover(projects.soilQueryReceivers.ktor)
kover(projects.soilQueryTest)
kover(projects.soilSerializationBundle)
kover(projects.soilForm)
kover(projects.soilSpace)
}