Auto-versioning Android builds

Android builds use two settings for build versions:

  • VersionName (android:versionName) is a string that represents the friendly version identifier that your users see. This could be based on Semantic Versioning, elements in the periodic table, or a member of an animal menagerie.

  • VersionCode (android:versionCode) is an integer value that is used to distinguish each build. Android uses this value to determine whether the latest version is installed.

    Common practice is to assign large numeric ranges to each kind of release you plan to deploy. For example, you might decide that 100,000-500,000 represents the range for beta releases, and 1,000,000-2,000,000 represents the range for stable releases. It’s important to note that the Google Play Developer Console won’t let you update to a build with a lower VersionCode value.

VersionCode

Buddybuild can update the VersionCode automatically for you. The process is done on the fly, does not require write access to the repo, and no changes will be committed back to the repo.

All you need to do is to turn on Auto-Versioning in the settings.

The Auto-versioning screen

VersionName

The best practice is to update VersionName in the build.gradle, and Buddybuild simply respects that.

Note

We do not recommend using the output from git describe --tags to inform the value of VersionName.

For performance reasons, buddybuild downloads only the minimal set of branches and commits from the repository. Often this means that buddybuild downloads only the HEAD commit for a single branch. As such, there may be insufficient information available from the repository to automatically set VersionName.

Buddybuild recommends manually specifying the VersionName, using Semantic Versioning and this template:

versionName = major.minor.versionCode

One idea is to make use of the environment variables listed here: Custom Build Steps

results matching ""

    No results matching ""