Skip to content

Commit a254bc6

Browse files
committed
fix: import Calendar for gradle script compatibility
1 parent 379b96f commit a254bc6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.Calendar
2+
13
plugins {
24
alias(libs.plugins.android.application)
35
alias(libs.plugins.kotlin.android)
@@ -18,8 +20,8 @@ android {
1820
targetSdk = 35
1921

2022
val tag = findProperty("versionTag")?.toString()?.removePrefix("v") ?: ""
21-
val cal = java.util.Calendar.getInstance()
22-
val dateCode = cal.get(java.util.Calendar.YEAR) * 10000 + (cal.get(java.util.Calendar.MONTH) + 1) * 100 + cal.get(java.util.Calendar.DAY_OF_MONTH)
23+
val cal = Calendar.getInstance()
24+
val dateCode = cal.get(Calendar.YEAR) * 10000 + (cal.get(Calendar.MONTH) + 1) * 100 + cal.get(Calendar.DAY_OF_MONTH)
2325
versionCode = tag.toIntOrNull() ?: dateCode
2426
versionName = if (tag.isNotBlank()) "v$tag" else "v$versionCode"
2527
}

0 commit comments

Comments
 (0)