Skip to content

Commit

Permalink
adds app versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSheva-mason committed Jun 29, 2021
1 parent 23d556c commit 8023e27
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ plugins {
id 'dagger.hilt.android.plugin'
}

ext.versionMajor = 0
ext.versionMinor = 8
ext.versionPatch = 0
ext.versionClassifier = "alpha"
ext.minimumSdkVersion = 24

def generateVersionCode() {
return ext.minimumSdkVersion * 10000000 + ext.versionMajor * 10000 + ext.versionMinor * 100 + ext.versionPatch
}

def generateVersionName() {
String versionName = "${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
if (ext.versionClassifier != null && !ext.versionClassifier.isEmpty()) {
versionName += "-" + ext.versionClassifier
}
return versionName
}

def localProperties = new Properties()
if (rootProject.file("local.properties").exists()) {
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
Expand All @@ -16,10 +34,10 @@ android {

defaultConfig {
applicationId "com.shevaalex.android.plugev"
minSdk 24
minSdk project.ext.minimumSdkVersion
targetSdk 30
versionCode 1
versionName "1.0"
versionCode generateVersionCode()
versionName generateVersionName()

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down

0 comments on commit 8023e27

Please sign in to comment.