Simply versioncode and versionname

This commit is contained in:
jacques 2022-01-10 18:39:04 +01:00
parent b618eef958
commit 24f8730729
2 changed files with 7 additions and 7 deletions

View file

@ -1,13 +1,13 @@
//noinspection GradleCompatible //noinspection GradleCompatible
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
ext.versionMajor = 0 /*ext.versionMajor = 0
ext.versionMinor = 65 ext.versionMinor = 65
ext.versionPatch = new Date().format("yyyyMMdd") ext.versionPatch = new Date().format("yyyyMMdd")
ext.versionClassifier = null ext.versionClassifier = null
ext.isSnapshot = false ext.isSnapshot = false
ext.minimumSdkVersion = defaultMinSdkVersion ext.minimumSdkVersion = defaultMinSdkVersion
ext.git_version= ("git rev-parse --short HEAD".execute().text.trim()) ext.git_version= ("git rev-parse --short HEAD".execute().text.trim())*/
// Try reading secrets from file // Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties") def secretsPropertiesFile = rootProject.file("secrets.properties")
@ -40,8 +40,8 @@ android {
applicationId "net.foucry.pilldroid" applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion targetSdkVersion defaultTargetSdkVersion
versionCode generateVersionCode() // 190010203 versionCode 100
versionName generateVersionName() // 1.2.3-SNAPSHOT versionName "beta+0.100"
multiDexEnabled true multiDexEnabled true
} }
@ -120,12 +120,11 @@ dependencies {
implementation 'com.journeyapps:zxing-android-embedded:4.3.0' implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0' implementation 'androidx.core:core:1.6.0'
// debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
implementation 'io.sentry:sentry-android:5.4.0' implementation 'io.sentry:sentry-android:5.4.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
} }
/*
private Integer generateVersionCode() { private Integer generateVersionCode() {
return ext.minimumSdkVersion * 1000 + ext.versionMajor * 100 + ext.versionMinor return ext.minimumSdkVersion * 1000 + ext.versionMajor * 100 + ext.versionMinor
} }
@ -146,4 +145,4 @@ private String generateVersionName() {
print "Version name = " + versionName print "Version name = " + versionName
return versionName return versionName
} }*/

View file

@ -24,6 +24,7 @@ ext {
defaultTargetSdkVersion = 30 defaultTargetSdkVersion = 30
defaultVersionCode = 1 defaultVersionCode = 1
defaultVersionCode1 = defaultVersionCode defaultVersionCode1 = defaultVersionCode
defaultVersionName = 'beta-0.+$versioncode'
} }
allprojects { allprojects {