Skip to content

Commit

Permalink
fx
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan09811 authored Feb 7, 2024
1 parent 2de3614 commit 94bcf78
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/pandroid/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,15 @@ fun getGitVersionName(): String {
var versionName = "0.0.0"

try {
val process = ProcessBuilder("git", "describe", "--exact-match")
val process = ProcessBuilder("git", "describe", "--abbrev=0")
.directory(project.rootDir)
.redirectOutput(Redirect.PIPE)
.start()
val isTag = process.waitFor() == 0

val tagProcess = ProcessBuilder("git", "describe", "--abbrev=0")
.directory(project.rootDir)
.redirectOutput(Redirect.PIPE)
.start()
val tag = tagProcess.inputStream.bufferedReader().readText().trim()
val tag = process.inputStream.bufferedReader().readText().trim()
if (!tag.isEmpty())
versionName = tag

if (!isTag)
versionName += "-" + getGitBranch() + "-" + getGitShortHash()
versionName += "-" + getGitBranch() + "-" + getGitShortHash()
} catch (e: Exception) {
logger.quiet("$e: defaulting to dummy version number $versionName")
}
Expand All @@ -92,6 +85,7 @@ fun getGitVersionName(): String {
return versionName
}


/**
* Returns the number of commits until the last tag
*/
Expand Down

0 comments on commit 94bcf78

Please sign in to comment.