mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-04 06:40:03 +00:00
Android: Use the git rev-list --count for versionCode
This commit is contained in:
parent
920dd0edd0
commit
135ac2a7a8
@ -25,8 +25,7 @@ android {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 25
|
||||
|
||||
// TODO This should be set to the Buildbot build number for release builds, and be "1" for debug builds.
|
||||
versionCode 13
|
||||
versionCode(getBuildVersionCode())
|
||||
|
||||
versionName "${getVersion()}"
|
||||
}
|
||||
@ -113,3 +112,16 @@ def getVersion() {
|
||||
|
||||
return versionNumber
|
||||
}
|
||||
|
||||
|
||||
def getBuildVersionCode() {
|
||||
try {
|
||||
def versionNumber = 'git rev-list --first-parent --count HEAD'.execute([], project.rootDir).text
|
||||
.trim()
|
||||
return Integer.valueOf(versionNumber);
|
||||
} catch (Exception e) {
|
||||
logger.error('Cannot find git, defaulting to dummy version number')
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user