-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add version numbering to dev builds #402
Open
schuyler
wants to merge
4
commits into
dev
Choose a base branch
from
schuyler/versioncode
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+96
−79
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5906639
Refactor CircleCI configuration to DRY with YAML references.
schuyler 74aaa6d
Use the CircleCI build number as the patch version if we're not build…
schuyler f60251f
Enable version numbers when building APKs on branches.
schuyler 22441b9
Use API 28 in CircleCI because that's actually what Gradle is expecting.
schuyler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why omit
z
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our
app/build.gradle
expectsversionNumber
to be in the form <major>.<minor>.<patch>. If we want the build number to appear in both theversionString
andversionCode
, it has to go somewhere, and I figured replacing the <patch> number of the latest release was the most innocuous way to do that.The alternative would be to continue to append the build number to the original
versionNumber
but then (a.)build.gradle
would need to be updated to permit that and (b.) theversionCode
wouldn't change between dev builds. (Maybe that's actually what we want?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, just to be clear on terminology, the fields are named
versionName
andversionCode
.The only practical effect of the
versionCode
is to prevent unintended downgrades. The Play Store will only perform automatic updates that increase theversionCode
. As far as I know, only the Play Store enforces this; the phone doesn't care whether thevesionCode
increases or not. Because we don't plan to ever publish development APKs to the Play Store, in some sense it doesn't matter what we use for dev builds.Any of these choices are fine:
versionCode
to 0 for all dev buildsversionName
isx.y.z
, setversionCode
to 1000000x + 10000y + z for all dev buildsversionName
isx.y.z
at patchlevel p, setversionCode
to 1000000x + 10000y + 100z + p for all dev buildsversionName
isx.y.z
, setversionCode
to 1000000x + 10000y + p for all dev buildsThe first is the simplest (it's what
build.gradle
currently does, and I think it will work fine—the net effect is that any production release will supersede (automatically install over) any development release.