Reputation: 1630
I have defined a gradle task that increments version code. The thing is that it is in the app.gradle and it runs with every build. My goal is to make it run on demand from our CI server.
Upvotes: 0
Views: 69
Reputation: 2467
Just make your task depends on a special task. In your case:
task incVersionCode(dependsOn: ["assembleRelease"]) << {
// your task code
}
you can also use this android gradle plugin for auto increasing version code: https://github.com/moallemi/gradle-advanced-build-version/
Upvotes: 1