This is a Gradle plugin, for Android developers, that automates app versioning. You can read more about this plugins inception here: http://alexfu.github.io/2015/11/09/Android-Auto-Versioning
Not having to remember or worry about when to bump version numbers allows you to focus on what's really important (implementing new features or fixing bugs).
This plugin comes with 3 simple tasks:
releaseMajor
releaseMinor
releasePatch
All of these tasks will do the following when executed:
- Bump version based on semantic versioning rules (http://semver.org)
- Commit the versioning file (using
git
) - Tag your current branch (again, using
git
)
NOTE: This plugin will not push any changes to your remote server. This is up to the developer to do.
To use this plugin...
Create a versioning file. This file is a simple JSON file that specifies the components that make up your version. Include it in your VCS.
{
"buildNumber": 99,
"major": 1,
"minor": 0,
"patch": 1,
"revision": 1
}
Include the following in your top-level build.gradle
file:
buildscript {
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.github.alexfu:androidautoversion:0.2.1'
}
}
Include the following in your app-level build.gradle
file:
apply plugin: 'com.github.alexfu.androidautoversion'
androidAutoVersion {
releaseTask "assembleRelease"
versionFile file('/path/to/version/file')
}
Remove versionCode
and versionName
from your defaultConfig
block!
Every time you want to make a release, decide if it's a major, minor, or a patch. Use the rules
outlined here to make your decision. Then, once you've decided, run the
release task that matches your release type (releaseMajor
, releaseMinor
, releasePatch
).
At the end of it all, you'll have a tagged branch and release APKs of each app variant.