-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
108 lines (91 loc) · 2.32 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
98
99
100
101
102
103
104
105
106
107
108
/*
* Copyright 2024-2025 Mayeku Khisa
*
* Use of this source code is governed by a MIT license as appearing in the
* LICENSE file included in the root of this source tree.
*/
import com.diffplug.spotless.extra.wtp.EclipseWtpFormatterStep
plugins {
distribution
alias(libs.plugins.diffplug.spotless)
}
spotless {
kotlinGradle {
target("**/*.kts")
targetExclude("**/build/**/*.kts", "**/src/**/*.kts")
ktlint()
licenseHeaderFile(rootProject.file("spotless/headers/kotlin.txt"), "^(?![\\/ ]\\*).").updateYearWithLatest(true)
}
with(rootProject.file("spotless/configs/prettierrc.json")) {
javascript {
target("src/**/*.mjs")
prettier().configFile(this@with)
}
json {
target("**/*.json")
targetExclude("**/build/**/*.json")
prettier().configFile(this@with)
}
typescript {
target("src/**/*.ts", "src/**/*.tsx")
prettier().configFile(this@with)
}
format("Css") {
target("src/**/*.css")
prettier().configFile(this@with)
}
format("Markdown") {
target("**/*.md")
targetExclude("/CHANGELOG.md", "**/build/**/*.md")
prettier().configFile(this@with)
}
format("Yaml") {
target("**/*.yml")
targetExclude("**/build/**/*.yml")
prettier().configFile(this@with)
}
}
format("FreeMarker") {
target("src/**/*.ftl")
licenseHeaderFile(rootProject.file("spotless/headers/freemarker.txt"), "^(?!<#| ~| -).")
.updateYearWithLatest(true)
}
format("Xml") {
target("src/**/*.xml")
eclipseWtp(EclipseWtpFormatterStep.XML).configFile(
rootProject.file("spotless/configs/xml.prefs"),
)
}
shell {
target("scripts/**/*.sh")
shfmt("3.10.0")
licenseHeaderFile(rootProject.file("spotless/shell-header.txt"), "^(?!#!|#).")
}
}
repositories {
mavenCentral()
}
version = rootProject.file("version.txt").readText().trim()
distributions {
main {
contents {
from(".") {
include("src/**", "catalog.json", "LICENSE", "version.txt")
}
}
}
}
tasks {
named<Tar>("distTar") {
compression = Compression.GZIP
archiveExtension.set("tar.gz")
}
register<Exec>("test") {
group = "verification"
description = "Runs the test suite"
commandLine("bash", "scripts/run-tests.sh")
}
named("build") {
dependsOn("test")
}
}