Skip to content

Commit 9d95cd5

Browse files
authored
Use BUILD_STARTED_AT instead of Instant.now() for build timestamp (#13175)
1 parent ce983d7 commit 9d95cd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paper-server/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
`maven-publish`
1212
idea
1313
id("io.papermc.paperweight.core")
14-
id("io.papermc.fill.gradle") version "1.0.7"
14+
id("io.papermc.fill.gradle") version "1.0.8"
1515
}
1616

1717
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
@@ -193,7 +193,7 @@ tasks.jar {
193193
val git = Git(rootProject.layout.projectDirectory.path)
194194
val mcVersion = rootProject.providers.gradleProperty("mcVersion").get()
195195
val build = System.getenv("BUILD_NUMBER") ?: null
196-
val buildTime = if (build != null) Instant.now() else Instant.EPOCH
196+
val buildTime = providers.environmentVariable("BUILD_STARTED_AT").map(Instant::parse).orElse(Instant.EPOCH).get()
197197
val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
198198
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
199199
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim()

0 commit comments

Comments
 (0)