Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Gradle plugin to manage an application version code inside its continuous integration lifecycle.

License

Notifications You must be signed in to change notification settings

X2Mobile/gradle-versioncode-plugin

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Release

gradle-versioncode-plugin

Gradle plugin to manage an application version code inside its continuous integration lifecycle.

This plugin was developed for the REST service: version-code-service.

Usage

Setup buildscript Dependencies

The plugin is available in JitPack. Just add the following to your buildscript dependencies:

buildscript {

    repositories {
    	....
        maven {
            url "https://jitpack.io"
        }
    }
    
    dependencies {
    	...
        classpath 'com.github.Mindera:gradle-versioncode-plugin:1.4'
    }
}

Apply it:

apply plugin: 'com.mindera.gradle.versioncode'

If you are using android flavors, this will generate a task for each combination of flavor and build type that are not debuggable.

For instance, if you have:

productFlavors {
        pro {
            applicationId = "com.example.my.pkg.pro"
        }
        free {
            applicationId = "com.example.my.pkg.free"
        }
    }

This plugin will generate the tasks:

incrementVersionCodeProRelease
incrementVersionCodeFreeRelease

Note: When using flavors, if you set the appVersionCode.appId it will be used for every flavor, if not it will use the value in applicationId.

Tasks Configuration

appVersionCode {
    appId = <app identifier> (do not use if you are using flavors)
    serviceEndpoint = <version code service endpoint>
}

Increment App's Version Code

Use the task 'incrementVersionCode'. For instance, in the command line type:

$ ./gradlew incrementVersionCode

If you're using android flavors, you could run:

$ ./gradlew incrementVersionCodeProRelease

Retrieve App's Current Version Code

import com.mindera.gradle.versioncode.utils.VersionCodeService
apply plugin: 'com.mindera.gradle.versioncode'
(...)
VersionCodeService versionCodeService = new VersionCodeService(<version code service endpoint>, <app identifier>)
return versionCodeService.currentVersionCode()

Dependencies

License

version-code-service is available under the MIT license. See the LICENSE file for more info.

About

Gradle plugin to manage an application version code inside its continuous integration lifecycle.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.