Skip to content

Commit

Permalink
Add calendar pattern to versionName and versionCode. (#36)
Browse files Browse the repository at this point in the history
Co-authored-by: Diar Gegaj <[email protected]>
  • Loading branch information
diargegaj and Diar Gegaj authored Oct 12, 2023
1 parent 9fe158d commit 38b9481
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import java.io.FileInputStream
import java.time.LocalDate
import java.util.Properties

plugins {
Expand Down Expand Up @@ -38,11 +39,16 @@ android {
}

defaultConfig {
val currentDate = LocalDate.now()
val year = currentDate.year
val month = currentDate.monthValue
val day = currentDate.dayOfMonth

applicationId = "com.diargegaj.recipesharing"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0-alpha"
versionCode = year * 10000 + month * 100 + day
versionName = "$year.$month.$day"

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

0 comments on commit 38b9481

Please sign in to comment.