android: generate versionCode automatically

It's a number whichb must be ever increasing with each build submitted to the
store.

Automate its value by using the number of seconds since 1st of January 2019.
That should be enough for ~680 years.
This commit is contained in:
Saúl Ibarra Corretgé 2019-03-21 10:24:40 +01:00
parent e29bc4bbb6
commit 030af37668
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,11 @@ if (googleServicesEnabled) {
apply plugin: 'io.fabric'
}
// Use the number of seconds/10 since Jan 1 2019 as the versionCode.
// This lets us upload a new build at most every 10 seconds for the
// next ~680 years.
// https://stackoverflow.com/a/38643838
def vcode = (int)(((new Date().getTime()/1000) - 1546297200) / 10)
android {
compileSdkVersion rootProject.ext.compileSdkVersion
@ -15,7 +20,7 @@ android {
defaultConfig {
applicationId 'org.jitsi.meet'
versionCode Integer.parseInt(project.buildNumber)
versionCode vcode
versionName project.appVersion
minSdkVersion rootProject.ext.minSdkVersion

View File

@ -17,6 +17,5 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
buildNumber=1
appVersion=19.1.0
sdkVersion=2.0.0