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:
parent
e29bc4bbb6
commit
030af37668
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue