mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-24 22:34:54 +00:00
Android: Use the git rev-list --count for versionCode
This commit is contained in:
parent
920dd0edd0
commit
135ac2a7a8
1 changed files with 14 additions and 2 deletions
|
@ -25,8 +25,7 @@ android {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
|
|
||||||
// TODO This should be set to the Buildbot build number for release builds, and be "1" for debug builds.
|
versionCode(getBuildVersionCode())
|
||||||
versionCode 13
|
|
||||||
|
|
||||||
versionName "${getVersion()}"
|
versionName "${getVersion()}"
|
||||||
}
|
}
|
||||||
|
@ -113,3 +112,16 @@ def getVersion() {
|
||||||
|
|
||||||
return versionNumber
|
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…
Add table
Reference in a new issue