-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
41 lines (33 loc) · 1.13 KB
/
build.gradle.kts
File metadata and controls
41 lines (33 loc) · 1.13 KB
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
plugins {
id("java")
id("com.gradleup.shadow") version "9.2.2"
}
val git : String = versionBanner()
val builder : String = builder()
ext["git_version"] = git
ext["builder"] = builder
subprojects {
apply(plugin = "java")
apply(plugin = "com.gradleup.shadow")
repositories {
mavenCentral()
}
tasks.processResources {
filteringCharset = "UTF-8"
filesMatching(arrayListOf("custom-nameplates.properties")) {
expand(rootProject.properties)
}
filesMatching(arrayListOf("*.yml", "*/*.yml", "META-INF/sponge_plugins.json")) {
expand(
Pair("project_version", rootProject.properties["project_version"]!!),
Pair("config_version", rootProject.properties["config_version"]!!)
)
}
}
}
fun versionBanner(): String = project.providers.exec {
commandLine("git", "rev-parse", "--short=8", "HEAD")
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")
fun builder(): String = project.providers.exec {
commandLine("git", "config", "user.name")
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")