summaryrefslogtreecommitdiff
path: root/gradle
diff options
context:
space:
mode:
authorjkoan <jkoan@users.noreply.github.com>2021-01-15 08:26:59 +0100
committerGitHub <noreply@github.com>2021-01-15 08:26:59 +0100
commit91222b892b2f796b8c18dff13eb15f888b276f3b (patch)
treeb31c6e801e995655689bc8ac50c4331a70000cb7 /gradle
parent3a02572d660f1abe1e1ee4e0e9a7b6210a38c7da (diff)
downloadnavit-91222b892b2f796b8c18dff13eb15f888b276f3b.tar.gz
fix:build:android: Fix VersionCode after 31.12.2020 (#1082)
* fix:build:android: Fix VersionCode after 31.12.2020 Currently the VewrsionCode has the Format yyMMddHHmm which breaked at 01.01.2021 because the maximum allowed Version by Google Play is 2100000000 because of the limitation of older Android Devices. Out currently highest VersionCode is 2012201504 and we need to keep it continuous, so the new Format would be yyyyMMddHH. Of cause this has the limitation that we can "only" create one Versioncode per Hour. But this is the the best @hoehnp and I came up yesterday. As a result a PR will follow which will remove the android build from the master build and instead will add it to a scheduled build (nightly build) * change:build:android:Implement @mvglasow's Idea about a Versioncode every 15min's
Diffstat (limited to 'gradle')
-rw-r--r--gradle/scripts/git-scm-version.gradle6
1 files changed, 5 insertions, 1 deletions
diff --git a/gradle/scripts/git-scm-version.gradle b/gradle/scripts/git-scm-version.gradle
index 685c95ed8..c6a7cfa09 100644
--- a/gradle/scripts/git-scm-version.gradle
+++ b/gradle/scripts/git-scm-version.gradle
@@ -15,7 +15,11 @@ import java.time.format.DateTimeFormatter
ext {
git = Grgit.open(currentDir: projectDir)
gitVersionName = git.describe(match: ["v[0-9.rc]*"])
- gitVersionCode = Integer.parseInt(DateTimeFormatter.ofPattern("yyMMddHHmm").format(git.head().dateTime))
+ hh = Integer.parseInt(DateTimeFormatter.ofPattern("HH").format(git.head().dateTime))
+ mm = Integer.parseInt(DateTimeFormatter.ofPattern("mm").format(git.head().dateTime))
+ hhmm = Math.round((hh*4)+(mm/15)).toString()
+ yyyyMMdd = DateTimeFormatter.ofPattern("yyyyMMdd").format(git.head().dateTime)
+ gitVersionCode = Integer.parseInt(yyyyMMdd + hhmm)
}
task printVersion() {