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
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index 1ed4630..33711fa 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -153,6 +153,11 @@
         "       inserts android:versionCode in to manifest.\n"
         "   --version-name\n"
         "       inserts android:versionName in to manifest.\n"
+        "   --replace-version\n"
+        "       If --version-code and/or --version-name are specified, these\n"
+        "       values will replace any value already in the manifest. By\n"
+        "       default, nothing is changed if the manifest already defines\n"
+        "       these attributes.\n"
         "   --custom-package\n"
         "       generates R.java into a different package.\n"
         "   --extra-packages\n"
@@ -532,6 +537,8 @@
                         goto bail;
                     }
                     bundle.setVersionName(argv[0]);
+                } else if (strcmp(cp, "-replace-version") == 0) {
+                    bundle.setReplaceVersion(true);
                 } else if (strcmp(cp, "-values") == 0) {
                     bundle.setValues(true);
                 } else if (strcmp(cp, "-include-meta-data") == 0) {