Merge pull request #11455 from t895/about-dialog

Android: Add about dialog
This commit is contained in:
Pierre Bourdon authored and GitHub committed 2023-01-24 13:16:15 +01:00
commit 014d0573b8
19 files changed
+894 -22

No files matched your search

+25 -1
View File
@@ -49,6 +49,9 @@ android {
versionName "${getVersion()}"
buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\""
buildConfigField "String", "BRANCH", "\"${getBranch()}\""
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@@ -172,7 +175,6 @@ def getVersion() {
return versionNumber
}
def getBuildVersionCode() {
try {
def versionNumber = 'git rev-list --first-parent --count HEAD'.execute([], project.rootDir).text
@@ -184,3 +186,25 @@ def getBuildVersionCode() {
return 1
}
def getGitHash() {
try {
def gitHash = 'git rev-parse HEAD'.execute([], project.rootDir).text.trim()
return gitHash
} catch (Exception e) {
logger.error(e + ': Cannot find git, defaulting to dummy build hash')
}
return 0
}
def getBranch() {
try {
def branch = 'git rev-parse --abbrev-ref HEAD'.execute([], project.rootDir).text.trim()
return branch
} catch (Exception e) {
logger.error(e + ': Cannot find git, defaulting to dummy build hash')
}
return 'master'
}