Changed version number to git commit count
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
parent
b95b47a98a
commit
22cd651405
2 changed files with 15 additions and 2 deletions
|
@ -5,12 +5,11 @@ plugins {
|
|||
|
||||
android {
|
||||
compileSdk 31
|
||||
|
||||
defaultConfig {
|
||||
applicationId "eu.toldi.balazs.anotherfeedreader"
|
||||
minSdk 26
|
||||
targetSdk 31
|
||||
versionCode 1
|
||||
versionCode project.getVersionCode()
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
|
14
build.gradle
14
build.gradle
|
@ -18,4 +18,18 @@ buildscript {
|
|||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
ext.getVersionCode = { ->
|
||||
try {
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine 'git', 'rev-list', '--first-parent', '--count', 'origin/main'
|
||||
standardOutput = stdout
|
||||
}
|
||||
return Integer.parseInt(stdout.toString().trim())
|
||||
}
|
||||
catch (ignored) {
|
||||
return -1;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue