summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xorg.fox.ttrss/build.gradle14
1 files changed, 11 insertions, 3 deletions
diff --git a/org.fox.ttrss/build.gradle b/org.fox.ttrss/build.gradle
index be621d57..887890b6 100755
--- a/org.fox.ttrss/build.gradle
+++ b/org.fox.ttrss/build.gradle
@@ -13,7 +13,7 @@ android {
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 31
compileSdk 35
- versionCode 563
+ versionCode getGitVersionCode()
versionName getVersion()
vectorDrawables.useSupportLibrary = true
}
@@ -55,6 +55,14 @@ android {
}
}
+def getGitVersionCode() {
+ return new Date(getGitTimestamp()).format('yyyyMMdd').toInteger()
+}
+
+def getGitTimestampFormatted() {
+ return new Date(getGitTimestamp()).format('YY.MM')
+}
+
def getGitTimestamp() {
// gitlab CI iso-8601 timestamp
if (System.getenv("CI_COMMIT_TIMESTAMP")) {
@@ -69,7 +77,7 @@ def getGitTimestamp() {
standardOutput = stdout
}
- return new Date(stdout.toString().trim().toLong() * 1000).format('YY.MM')
+ return stdout.toString().trim().toLong() * 1000;
}
catch (ignored) {
return 0;
@@ -97,7 +105,7 @@ def getGitCommitHash() {
}
def getVersion() {
- return getGitTimestamp() + '-' + getGitCommitHash();
+ return getGitTimestampFormatted() + '-' + getGitCommitHash();
}
dependencies {