Application is automatically building by jenkins after successful push, but version is always 1.0. Instead of "0" I want to insert number of corresponding build in jenkins: 1.119, 1.120, 1.121...
That is my build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
}
}
allprojects {
repositories {
mavenCentral()
}
}
build.sh
#!/bin/bash
gradle clean
gradle build
#. run_android_ui_tests.sh
My gradle.properities contains only comments.
Problem solved by inserting these two strings into build.gradle's defaultConfig:
def env = System.getenv()
versionName "1." + env['BUILD_NUMBER']
instead of
versionName "1.0"
You have to make some preprocessing of your Manifest or build.gradle.
Fro example
I recommend you to get a system value that you can determine in each build you have, so you can change version of the app yourself in build configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With