mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #6387 from mahdihijazi/fix_build_no
Android: Use the git rev-list --count for versionCode
This commit is contained in:
@ -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()}"
|
||||||
}
|
}
|
||||||
@ -112,3 +111,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;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user