-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
93 lines (80 loc) · 2.78 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
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val VERSION_NAME: String by properties
val JAVA_VERSION: String by properties
fun properties(key: String) = project.findProperty(key).toString()
plugins {
id("org.jetbrains.changelog") version "2.0.0"
id("com.diffplug.spotless") version "6.11.0" apply false
}
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${lintLibs.versions.kotlin.get()}")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.22.0")
}
}
version = VERSION_NAME
changelog {
path.set("$rootDir/changelog.md")
version.set(VERSION_NAME)
}
allprojects {
repositories {
mavenCentral()
google()
}
tasks {
withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = JAVA_VERSION
kotlinOptions.freeCompilerArgs += "-Xcontext-receivers"
}
withType<JavaCompile>().configureEach {
sourceCompatibility = JAVA_VERSION
targetCompatibility = JAVA_VERSION
}
}
}
subprojects {
apply(plugin = "com.diffplug.spotless")
configure<SpotlessExtension> {
kotlin {
ktlint("0.47.1")
// Spotless doesn't respect .editorconfig yet.
// https://github.com/diffplug/spotless/issues/142
.editorConfigOverride(
mapOf(
"charset" to "utf-8",
"end_of_line" to "lf",
"trim_trailing_whitespace" to true,
"insert_final_newline" to true,
"indent_style" to "space",
"indent_size" to 4,
"ij_kotlin_allow_trailing_comma" to true,
"ij_kotlin_allow_trailing_comma_on_call_site" to true
)
)
}
kotlinGradle {
ktlint("0.47.1")
// Spotless doesn't respect .editorconfig yet.
// https://github.com/diffplug/spotless/issues/142
.editorConfigOverride(
mapOf(
"charset" to "utf-8",
"end_of_line" to "lf",
"trim_trailing_whitespace" to true,
"insert_final_newline" to true,
"indent_style" to "space",
"indent_size" to 4,
"ij_kotlin_allow_trailing_comma" to true,
"ij_kotlin_allow_trailing_comma_on_call_site" to true
)
)
}
}
}