Android: Add about dialog

This commit is contained in:
Charles Lombardo committed 2023-01-18 15:58:06 -05:00
1 parent 30f0051f9c
commit b598b6ec72
19 files changed
+894 -22

No files matched your search

+25 -1
View File
@@ -41,6 +41,9 @@ android {
versionName "${getVersion()}"
buildConfigField "String", "GIT_HASH", "\"${getGitHash()}\""
buildConfigField "String", "BRANCH", "\"${getBranch()}\""
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@@ -162,7 +165,6 @@ def getVersion() {
return versionNumber
}
def getBuildVersionCode() {
try {
def versionNumber = 'git rev-list --first-parent --count HEAD'.execute([], project.rootDir).text
@@ -174,3 +176,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'
}