Skip to content

Commit

Permalink
fixes: #199
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Apr 4, 2024
1 parent 34fbc01 commit a3de0b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -34,15 +35,16 @@ buildConfig {
buildConfigField("String", "COMPOSE_VERSION", "\"${project.findProperty("compose.version")}\"")
try
{
val grgit = if (extra.has("grgit")) null else the<Grgit>()
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.
Expand Down

0 comments on commit a3de0b2

Please sign in to comment.