Add git version
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("java")
|
id("java")
|
||||||
id("com.github.johnrengelman.shadow") version "7.1.0"
|
id("com.github.johnrengelman.shadow") version "7.1.0"
|
||||||
@@ -46,3 +48,13 @@ publishing {
|
|||||||
dependencies {
|
dependencies {
|
||||||
compileOnly("com.alttd:Galaxy-API:1.19.2-R0.1-SNAPSHOT")
|
compileOnly("com.alttd:Galaxy-API:1.19.2-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun gitCommit(): String {
|
||||||
|
val os = ByteArrayOutputStream()
|
||||||
|
project.exec {
|
||||||
|
isIgnoreExitValue = true
|
||||||
|
commandLine = "git rev-parse --short HEAD".split(" ")
|
||||||
|
standardOutput = os
|
||||||
|
}
|
||||||
|
return String(os.toByteArray()).trim()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user