Merge pull request #3296 from mcclure/live-without-git-2

Fix non-git build
This commit is contained in:
Konrad Pozniak 2023-02-10 22:01:27 +01:00 committed by GitHub
commit cc0b5ae1a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 3 deletions

View File

@ -5,9 +5,18 @@ plugins {
alias(libs.plugins.kotlin.parcelize)
}
final def gitSha = providers.exec {
commandLine('git', 'rev-parse', '--short=7', 'HEAD')
}.standardOutput.asText.get().trim()
// For constructing gitSha only
def getGitSha = {
try {
providers.exec {
commandLine 'git', 'rev-parse', 'HEAD'
}.standardOutput.asText.get().trim()
} catch (Exception e) {
"unknown" // Try-catch is necessary for build to work on non-git distributions
}
}
final def gitSha = getGitSha()
// The app name
final def APP_NAME = "Tusky"