mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Android: Add about dialog
This commit is contained in:
@ -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'
|
||||
}
|
||||
|
Reference in New Issue
Block a user