Changed version number to git commit count
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
Balazs Toldi 2021-10-06 21:06:54 +02:00
parent b95b47a98a
commit 22cd651405
Signed by: Bazsalanszky
GPG key ID: 933820884952BE27
2 changed files with 15 additions and 2 deletions

View file

@ -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"

View file

@ -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;
}
}