mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-22 16:39:36 +00:00
40 lines
1.1 KiB
Plaintext
40 lines
1.1 KiB
Plaintext
import org.gradle.process.internal.ExecException
|
|
import java.io.ByteArrayOutputStream
|
|
|
|
plugins {
|
|
id("java")
|
|
id("com.gradleup.shadow") version "9.0.0-beta11"
|
|
}
|
|
|
|
val git : String = versionBanner()
|
|
val builder : String = builder()
|
|
ext["git_version"] = git
|
|
ext["builder"] = builder
|
|
|
|
subprojects {
|
|
apply(plugin = "java")
|
|
apply(plugin = "com.gradleup.shadow")
|
|
|
|
tasks.processResources {
|
|
filteringCharset = "UTF-8"
|
|
|
|
filesMatching(arrayListOf("custom-crops.properties")) {
|
|
expand(rootProject.properties)
|
|
}
|
|
|
|
filesMatching(arrayListOf("*.yml", "*/*.yml")) {
|
|
expand(
|
|
Pair("project_version", rootProject.properties["project_version"]),
|
|
Pair("config_version", rootProject.properties["config_version"])
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
fun versionBanner() = project.providers.exec {
|
|
commandLine("git", "rev-parse", "--short=8", "HEAD")
|
|
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown")
|
|
|
|
fun builder() = project.providers.exec {
|
|
commandLine("git", "config", "user.name")
|
|
}.standardOutput.asText.map { it.trim() }.getOrElse("Unknown") |