Add git version
This commit is contained in:
parent
a263f400e3
commit
b7c6b903e0
|
|
@ -1,5 +1,3 @@
|
||||||
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"
|
||||||
|
|
@ -48,13 +46,3 @@ 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()
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("com.github.johnrengelman.shadow")
|
id("com.github.johnrengelman.shadow")
|
||||||
|
|
@ -12,7 +14,7 @@ dependencies {
|
||||||
tasks {
|
tasks {
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
archiveFileName.set("${rootProject.name}-${project.version}.jar")
|
archiveFileName.set("${rootProject.name}.jar")
|
||||||
}
|
}
|
||||||
|
|
||||||
build {
|
build {
|
||||||
|
|
@ -20,3 +22,13 @@ tasks {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun gitCommit(): String {
|
||||||
|
val os = ByteArrayOutputStream()
|
||||||
|
project.exec {
|
||||||
|
isIgnoreExitValue = true
|
||||||
|
commandLine = "git rev-parse --short HEAD".split(" ")
|
||||||
|
standardOutput = os
|
||||||
|
}
|
||||||
|
return String(os.toByteArray()).trim()
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user