mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
Only include build time in manifest for numbered builds
This commit is contained in:
parent
c55ad7092c
commit
e97bf6933c
1 changed files with 2 additions and 2 deletions
|
@ -181,12 +181,12 @@ dependencies {
|
||||||
// Paper end - spark
|
// Paper end - spark
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tasks.jar {
|
tasks.jar {
|
||||||
manifest {
|
manifest {
|
||||||
val git = Git(rootProject.layout.projectDirectory.path)
|
val git = Git(rootProject.layout.projectDirectory.path)
|
||||||
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
|
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
|
||||||
val build = System.getenv("BUILD_NUMBER") ?: null
|
val build = System.getenv("BUILD_NUMBER") ?: null
|
||||||
|
val buildTime = if (build != null) Instant.now() else Instant.EPOCH
|
||||||
val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
|
val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
|
||||||
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
|
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
|
||||||
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim() // Paper
|
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim() // Paper
|
||||||
|
@ -202,7 +202,7 @@ tasks.jar {
|
||||||
"Brand-Id" to "papermc:paper",
|
"Brand-Id" to "papermc:paper",
|
||||||
"Brand-Name" to "Paper",
|
"Brand-Name" to "Paper",
|
||||||
"Build-Number" to (build ?: ""),
|
"Build-Number" to (build ?: ""),
|
||||||
"Build-Time" to Instant.now().toString(),
|
"Build-Time" to buildTime.toString(),
|
||||||
"Git-Branch" to gitBranch, // Paper
|
"Git-Branch" to gitBranch, // Paper
|
||||||
"Git-Commit" to gitHash, // Paper
|
"Git-Commit" to gitHash, // Paper
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue