Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-06-03 13:40:52 +02:00
commit 35f14f4549
3 changed files with 4 additions and 9 deletions

View file

@ -2,8 +2,8 @@ apply plugin: 'com.android.application'
// Global Parameters accepted
// TARGET_APP_NAME - app name
// APK_NUMBER_VERSION - version number of apk
// APK_VERSION_SUFFIX - build number like #99999Z (for dev builds only)
// flavor Z : M=-master, D=-design, B=-Blackberry, MD=-main-default, MQA=-main-qt-arm, MQDA=-main-qt-default-arm, S=-sherpafy
// APK_VERSION_SUFFIX - build number like #99999Z, appended (for dev builds) to Manifest's versionName as X.X.X#99999Z
// Z means flavor: M=-master, D=-main-default, B=-Blackberry, Des=-design, MQA=-main-qt-arm, MQDA=-main-qt-default-arm, S=-sherpafy
// APP_EDITION - date stamp of builds
// APP_FEATURES - features +play_market +gps_status -parking_plugin -blackberry -free_version -amazon
@ -42,6 +42,7 @@ android {
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
multiDexEnabled true
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
//versionName System.getenv("APK_VERSION_SUFFIX")? versionName + System.getenv("APK_VERSION_SUFFIX").toString(): versionName
}
lintOptions {
@ -187,7 +188,6 @@ def replaceNoTranslate(line) {
// return line.replaceAll(">[^<]*<", ">" + System.getenv("APK_VERSION") + "<")
// }
if (line.contains("\"app_version_suffix\"") && System.getenv("APK_VERSION_SUFFIX")) {
// appends build number to version number for dev builds
return line.replaceAll("</", System.getenv("APK_VERSION_SUFFIX") + "</")
}
if (line.contains("\"versionFeatures\"") && System.getenv("APP_FEATURES")) {

View file

@ -3,12 +3,6 @@
<string name="app_name">OsmAnd~</string>
<string name="app_name_free">OsmAndF~</string>
<string name="app_version_suffix"></string>
<!--
Note: appVersion will be concatenated via Manifest's "android:versionName" ("X.X.X") and the build info "app_version_suffix" ("#YYYYYZ" for dev builds only) as follows:
X.X.X#YYYYYZ , where
YYYYY is the build number of build branch Z
Z : M=-master, D=-main-default, B=-Blackberry, Des=-design, MQA=-main-qt-arm, MQDA=-main-qt-default-arm, S=-sherpafy
-->
<!-- Not translatable -->
<string name="full_version_price">€5,99</string>

View file

@ -54,6 +54,7 @@ public class Version {
int versionCode = -1;
try {
PackageInfo packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
//appVersion = packageInfo.versionName; //already appended in build.gradle: + ctx.getString(R.string.app_version_suffix);
appVersion = packageInfo.versionName + ctx.getString(R.string.app_version_suffix);
versionCode = packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException e) {