summaryrefslogtreecommitdiff
path: root/tools/aapt/Bundle.h
diff options
context:
space:
mode:
authorJeff Davidson <jpd@google.com>2014-02-25 12:28:08 -0800
committerJeff Davidson <jpd@google.com>2014-02-25 13:42:12 -0800
commitdf08d1c24dbbc242978ee33416d1e54998f88915 (patch)
tree1f933fa448fcac027fb3b7bb0fc9cba1e273c510 /tools/aapt/Bundle.h
parentc1970190549519acde6719c777f53611674058cb (diff)
Add --replace-version flag to aapt.
Motivation: we'd like to programmatically specify the version name/code (i.e. to include the build number from the build server). However, this means that we cannot specify version info in the AndroidManifest.xml file, as this takes precedence. Not doing so makes IDE use more difficult, as the IDE gets version code 0 and won't install over an existing non-IDE version unless you first force a downgrade to an IDE build from the command line. This flag allows us to specify a very high version code in the AndroidManifest.xml file, making IDE builds take precedence, while still allowing us to override this info when performing command-line (official) builds. Change-Id: I5d01048698af5c26bdf19066c6cd4eca1115112a
Diffstat (limited to 'tools/aapt/Bundle.h')
-rw-r--r--tools/aapt/Bundle.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h
index cbeaae84d573..49b8b55cb8df 100644
--- a/tools/aapt/Bundle.h
+++ b/tools/aapt/Bundle.h
@@ -59,10 +59,10 @@ public:
mAndroidManifestFile(NULL), mPublicOutputFile(NULL),
mRClassDir(NULL), mResourceIntermediatesDir(NULL), mManifestMinSdkVersion(NULL),
mMinSdkVersion(NULL), mTargetSdkVersion(NULL), mMaxSdkVersion(NULL),
- mVersionCode(NULL), mVersionName(NULL), mCustomPackage(NULL), mExtraPackages(NULL),
- mMaxResVersion(NULL), mDebugMode(false), mNonConstantId(false), mProduct(NULL),
- mUseCrunchCache(false), mErrorOnFailedInsert(false), mErrorOnMissingConfigEntry(false),
- mOutputTextSymbols(NULL),
+ mVersionCode(NULL), mVersionName(NULL), mReplaceVersion(false), mCustomPackage(NULL),
+ mExtraPackages(NULL), mMaxResVersion(NULL), mDebugMode(false), mNonConstantId(false),
+ mProduct(NULL), mUseCrunchCache(false), mErrorOnFailedInsert(false),
+ mErrorOnMissingConfigEntry(false), mOutputTextSymbols(NULL),
mSingleCrunchInputFile(NULL), mSingleCrunchOutputFile(NULL),
mArgc(0), mArgv(NULL)
{}
@@ -166,6 +166,8 @@ public:
void setVersionCode(const char* val) { mVersionCode = val; }
const char* getVersionName() const { return mVersionName; }
void setVersionName(const char* val) { mVersionName = val; }
+ bool getReplaceVersion() { return mReplaceVersion; }
+ void setReplaceVersion(bool val) { mReplaceVersion = val; }
const char* getCustomPackage() const { return mCustomPackage; }
void setCustomPackage(const char* val) { mCustomPackage = val; }
const char* getExtraPackages() const { return mExtraPackages; }
@@ -285,6 +287,7 @@ private:
const char* mMaxSdkVersion;
const char* mVersionCode;
const char* mVersionName;
+ bool mReplaceVersion;
const char* mCustomPackage;
const char* mExtraPackages;
const char* mMaxResVersion;