Skip to content

Commit

Permalink
fix:build:android: Fix VersionCode after 31.12.2020 (#1082)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jkoan committed Jan 15, 2021
1 parent 3a02572 commit 91222b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gradle/scripts/git-scm-version.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 91222b8

Please sign in to comment.