-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle.kts
61 lines (55 loc) · 2.49 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
import com.diffplug.gradle.spotless.SpotlessExtension
import com.diffplug.gradle.spotless.SpotlessPlugin
plugins {
kotlin("jvm") version "1.8.20" apply false
id("com.bennyhuo.kotlin.trimindent") version "1.8.20-1.0.0" apply false
id("org.jetbrains.dokka") version "1.7.10" apply false
id("com.github.gmazzo.buildconfig") version "2.1.0" apply false
id("com.vanniktech.maven.publish") version "0.22.0" apply false
id("com.bennyhuo.kotlin.plugin.embeddable") version "1.8.1" apply false
id("com.bennyhuo.kotlin.plugin.embeddable.test") version "1.8.1" apply false
id("com.diffplug.gradle.spotless") version "6.21.0" apply false
}
subprojects {
repositories {
mavenCentral()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots")
}
if (!name.startsWith("sample") && parent?.name?.startsWith("sample") != true) {
group = property("GROUP").toString()
version = property("VERSION_NAME").toString()
apply(plugin = "com.vanniktech.maven.publish")
apply<SpotlessPlugin>()
extensions.configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/build/**/*.kt")
targetExclude("**/testData/**/*.kt")
ktlint("0.49.1").userData(
mapOf(
"android" to "true",
"max_line_length" to "200",
"ij_kotlin_allow_trailing_comma" to "false",
"ij_kotlin_allow_trailing_comma_on_call_site" to "false"
)
)
licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
}
format("kts") {
target("**/*.kts")
targetExclude("**/build/**/*.kts")
// Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
}
format("xml") {
target("**/*.xml")
targetExclude("**/build/**/*.xml")
// Look for the first XML tag that isn't a comment (<!--) or the xml declaration (<?xml)
licenseHeaderFile(rootProject.file("spotless/copyright.xml"), "(<[^!?])")
}
}
}
pluginManager.withPlugin("java") {
extensions.getByType<JavaPluginExtension>().sourceCompatibility = JavaVersion.VERSION_1_8
}
}