-
Notifications
You must be signed in to change notification settings - Fork 134
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
Versioning an Android application #253
Comments
This should work: [bumpversion]
current_version = 1.0
parse = (?P<major>\d+).(?P<minor>\d+)
serialize =
{major}.{minor}
[bumpversion:file (versionName):build.gradle]
search = versionName "{current_version}"
replace = versionName "{new_version}"
[bumpversion:file (versionCode):build.gradle]
serialize =
{major}
search = versionCode {current_version}
replace = versionCode {new_version} |
@Maccheroni I do not believe that will work. It will only set If hypothetically we released an Android application starting with 1.0 we'd want to maintain
Bumpversion, as it stands, does not have a way to get a handle on what Android apps need as the Hope that makes sense. |
@rbprogrammer the unreleased version 1.0.2-dev has a configuration option indepenent for a part. By default when parent part is bumped, children part is set to its first value, and if part is independent, it retains the previous value. If I understand correctly, you want the part to increment every time the parent part changes. I added configuration option always_increment in my fork
|
Has there been any thought as to how bump2version can be used to change the version of an Android project?
Typically an Android project has a
<repo>/app/build.gradle
file that has something like:Where
android.defaultConfig.versionCode
is basically a one-up counter, andandroid.defaultConfig.versionName
usually follows the form{major}.{minor}
(rarely does it have a patch element) -- per the Android versioning documentation.I have not yet tested it, but I believe bump2version should be able to handle versionName (major.minor) but I do not know how it can handle versionCode (one-up counter), if it even could. Initially I would write a config with:
But this won't work for versionCode. Any idea how I can finagle something into versionCode to be consistent with how it is normally handled by Android?
The text was updated successfully, but these errors were encountered: