Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.gradle: Always increase versionCode for Green #4438

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

nailyk-fr
Copy link
Collaborator

@nailyk-fr nailyk-fr commented May 10, 2024

Due to Android (and the F-Droid) upgrade process, versionCode should always increase in order to trigger the update process.

Use a dedicated versionCode for Green releases, time base, which will always increase (beware of time zones ⚠️ )

Another side effect will be: the same code, rebuilt, will be considered as an upgrade, as build time will be newer.

It is impossible to use the commit number as it is not an int. A better idea would be to count the amounts of commits, with something like git rev-list --first-parent --count HEAD but I didn't manage to do it.

versionName remains the same, with the commit number, but versionCode increases, offering an update on every build :

image

signal-2024-05-10-182448_002

Due to Android (and the F-Droid) upgrade process, `versionCode` should always increase in order to trigger the update process. 

Use a dedicated `versionCode` for Green releases, time base, which will always increase (beware of time zones ⚠️ )

Another side effect will be: the same code, rebuilt, will be considered as an upgrade, as build time will be newer. 

It is impossible to use the commit number as it is not an `int`. 
A better idea would be to count the amounts of commits, with something like  `git rev-list --first-parent --count HEAD` but I didn't manage to do it.
@connyduck
Copy link
Collaborator

I don't like this as I often install older builds over newer ones and that only works when they have the same versionCode. Also it probably breaks Google Play nightly builds. Why can't you run a script that changes the versionCode before building? Something like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants