From 9524c1313cebe489a7ce5141f7b3734ca655cbb9 Mon Sep 17 00:00:00 2001 From: Maximov Valery Date: Wed, 5 Jun 2024 08:34:42 +0300 Subject: [PATCH] add buildtime --- build.gradle.kts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3f4c1d1de9d..5a70f42f60f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ import gradlegitproperties.org.ajoberstar.grgit.Grgit import me.qoomon.gitversioning.commons.GitRefType import org.apache.tools.ant.filters.EscapeUnicode import java.util.* +import java.text.SimpleDateFormat plugins { `java-library` @@ -52,7 +53,7 @@ gitVersioning.apply { } gitProperties { - customProperty("git.build.time", "2018-03-28T05:13:53Z") + customProperty("git.build.time", buildTime()) } val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG @@ -390,3 +391,9 @@ nexusStaging { tasks.withType { enabled = false } + +fun buildTime(): String { + val formatter = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'") + formatter.timeZone = TimeZone.getTimeZone("UTC") + return formatter.format(Date()) +}