From abb7b8db74047ba2a4f9e35e0dd77b2357951421 Mon Sep 17 00:00:00 2001 From: Shiliu Wang Date: Wed, 18 Sep 2013 14:07:39 +0800 Subject: [PATCH] [Android] Specify version code/name for android outputs at gyp time The version in AndroidManifest.xml has two parts:versionCode and versionName. VersionCode is an increasing integer to identifing upgrade. VersionName is a human readable string. For xwalk, VERSION file should be the only place to maintain version. So this patch removes the hard coding in AndroidManifest.xml. Insteadly, version code and version name will be specified as parameters at gyp time for android's ant action. For versionCode, it's calculated through version. The formula is: versionCode = shift + patch * 10 + build * 1000 + (major+minor) * 100000 Shift is the configuration bit. Currently, 1 for x86, 2 for armv7 and 3 for arm. --- .../android/runtimelib/AndroidManifest.xml | 1 - tools/build/android/generate_version_code.py | 90 +++++++++++++++++++ xwalk.gyp | 17 ++++ xwalk_android.gypi | 2 + 4 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 tools/build/android/generate_version_code.py diff --git a/runtime/android/runtimelib/AndroidManifest.xml b/runtime/android/runtimelib/AndroidManifest.xml index 76bb90ab37..64be5002fe 100644 --- a/runtime/android/runtimelib/AndroidManifest.xml +++ b/runtime/android/runtimelib/AndroidManifest.xml @@ -7,7 +7,6 @@ -->