This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
android:android_build_configuration [2019/08/15 20:52] timm |
android:android_build_configuration [2019/08/19 18:35] (current) timm |
||
---|---|---|---|
Line 21: | Line 21: | ||
<code java> | <code java> | ||
// Compute the versionCode and versionName which is used in the Manifest to identify the build | // Compute the versionCode and versionName which is used in the Manifest to identify the build | ||
- | versionCode = versionMajor * 1000000 + versionMinor * 10000 + buildNum | + | versionCode = versionMajor * 1000000 + versionMinor * 10000 + buildNum |
- | versionName = String.valueOf(versionMajor) + "." + String.valueOf(versionMinor) + "." + String.valueOf(versionHotfix) | + | versionName = String.valueOf(versionMajor) + "." + String.valueOf(versionMinor) + "." + String.valueOf(versionHotfix) |
- | </code> | + | </code> |
| | ||
The code above creates two Gradle environment variables "versionCode" and "versionName". The versionCode variable is used to create a build number which is substituted into the AndroidManifest.xml for each build. This is the number that must role forward for every APK created. It take the major, minor and build number to create a unique build number. The key is the use of the Jenkins build number which is always moving forward for any given release build. The versionName is just the normal human readable version name such as 2.4.1. It is also used in the AndroidManifest.xml file and is grabbed by the About page in each app. | The code above creates two Gradle environment variables "versionCode" and "versionName". The versionCode variable is used to create a build number which is substituted into the AndroidManifest.xml for each build. This is the number that must role forward for every APK created. It take the major, minor and build number to create a unique build number. The key is the use of the Jenkins build number which is always moving forward for any given release build. The versionName is just the normal human readable version name such as 2.4.1. It is also used in the AndroidManifest.xml file and is grabbed by the About page in each app. | ||