From 934f21a15cad6eca4d5769a13ca6d61fc6379a1c Mon Sep 17 00:00:00 2001 From: zoff99 Date: Thu, 4 Apr 2024 08:17:56 +0200 Subject: [PATCH] fixes: https://github.com/Zoxcore/trifa_material/issues/199 see: https://github.com/ajoberstar/grgit/issues/361 --- build.gradle.kts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 595b72f4..a219566d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat import de.undercouch.gradle.tasks.download.Download +import org.ajoberstar.grgit.Grgit import java.time.format.DateTimeFormatter plugins { @@ -34,15 +35,16 @@ buildConfig { buildConfigField("String", "COMPOSE_VERSION", "\"${project.findProperty("compose.version")}\"") try { + val grgit = if (extra.has("grgit")) null else the() try { - buildConfigField("String", "GIT_BRANCH", "\"" + grgit.branch.current().fullName + "\"") + buildConfigField("String", "GIT_BRANCH", "\"" + grgit!!.branch.current().fullName + "\"") } catch (e: Exception) { buildConfigField("String", "GIT_BRANCH", "\"" + "????" + "\"") } - buildConfigField("String", "GIT_COMMIT_HASH", "\"" + grgit.head().abbreviatedId + "\"") + buildConfigField("String", "GIT_COMMIT_HASH", "\"" + grgit!!.head().abbreviatedId + "\"") buildConfigField("String", "GIT_COMMIT_DATE", "\"" + grgit.head().dateTime. format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "\"") buildConfigField("String", "GIT_COMMIT_MSG", "\"" + grgit.head().shortMessage.