Incrementing Android app version

To make your build version management easy, Nevercode exports two environment variables that you can use in your build scripts: NEVERCODE_BUILD and NEVERCODE_BUILD_NUMBER. Read more about their meaning from here.
You can also take a look at other read-only environment variables exported by Nevercode during the build.

To increment your Android app version, you will need a script that looks like this:

android {
    compileSdkVersion 21
    buildToolsVersion "21.1"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
        if (System.getenv("CI")) {
            def buildNumber = System.getenv("NEVERCODE_BUILD_NUMBER")
            versionName = "1.0." + buildNumber 
            versionCode = Integer.valueOf(buildNumber)


The script above is just an example script that enables incrementation of Android app version.

In your build.gradle script, you can check these values with

nevercodeBuild = System.getenv("NEVERCODE_BUILD")
nevercodeBuildNumber = System.getenv("NEVERCODE_BUILD_NUMBER")

Updated 2 years ago

Incrementing Android app version

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.