From 38b948111698c0ea581a9978ea2f6517bd76bf21 Mon Sep 17 00:00:00 2001 From: diargegaj <58120779+diargegaj@users.noreply.github.com> Date: Thu, 12 Oct 2023 22:54:57 +0200 Subject: [PATCH] Add calendar pattern to versionName and versionCode. (#36) Co-authored-by: Diar Gegaj --- app/build.gradle.kts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c37ae0a..3e1fe0a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,4 +1,5 @@ import java.io.FileInputStream +import java.time.LocalDate import java.util.Properties plugins { @@ -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 {