Fallback to the buildconfig for the default timestamp

This commit is contained in:
Thomas Andres Gomez 2024-01-11 09:16:33 +01:00
parent a009e6c831
commit 1079f4e5c6
5 changed files with 20 additions and 5 deletions

View file

@ -66,6 +66,11 @@ android {
}
}
defaultConfig {
buildConfigField("String", "TIME_FORMAT", "\"$timeFormat\"")
buildConfigField("Long", "TIMESTAMP", "${timestamp}L")
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
@ -166,7 +171,13 @@ room {
schemaDirectory("$projectDir/schemas")
}
val gitBuildNumber: Int
private val timeFormat: String
get() = "dd/MM/yyyy HH:mm:ss"
private val timestamp: Long
get() = System.currentTimeMillis()
private val gitBuildNumber: Int
get() {
val stdout = org.apache.commons.io.output.ByteArrayOutputStream()
rootProject.exec {