9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2026-01-06 15:51:50 +00:00
Files
Custom-Fishing/build.gradle.kts
2024-05-18 03:16:02 +08:00

43 lines
1011 B
Plaintext

import java.io.ByteArrayOutputStream
plugins {
id("java")
}
val commitID : String = versionBanner()
ext["commitID"] = commitID
subprojects {
apply(plugin = "java")
apply(plugin = "java-library")
repositories {
mavenCentral()
}
tasks.processResources {
filteringCharset = "UTF-8"
filesMatching(arrayListOf("library-version.properties")) {
expand(rootProject.properties)
}
filesMatching(arrayListOf("plugin.yml", "*.yml", "*/*.yml")) {
expand(
Pair("git_version", commitID),
Pair("project_version", rootProject.properties["project_version"]),
Pair("config_version", rootProject.properties["config_version"])
)
}
}
}
fun versionBanner(): String {
val os = ByteArrayOutputStream()
project.exec {
commandLine = "git rev-parse --short=8 HEAD".split(" ")
standardOutput = os
}
return String(os.toByteArray()).trim()
}