Add buildnumber
This commit is contained in:
parent
cf9619d0f9
commit
687e063ad9
|
|
@ -1,4 +1,5 @@
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
|
||||||
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("java")
|
id("java")
|
||||||
|
|
@ -6,7 +7,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "com.alttd"
|
group = "com.alttd"
|
||||||
version = "2.1.6"
|
version = System.getenv("BUILD_NUMBER") ?: gitCommit()
|
||||||
description = "Altitude AFK Detector plugin."
|
description = "Altitude AFK Detector plugin."
|
||||||
apply<JavaLibraryPlugin>()
|
apply<JavaLibraryPlugin>()
|
||||||
|
|
||||||
|
|
@ -45,4 +46,14 @@ tasks {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT")
|
implementation("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT")
|
||||||
compileOnly("de.keyle:mypet:3.11-SNAPSHOT")
|
compileOnly("de.keyle:mypet:3.11-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()
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user