AAPT2: Add support to specify stable IDs
The --stable-ids flag allows the user to specify a file containing
a list of resource name and resource ID pairs in the form of:
package:type/name = 0xPPTTEEEE
This assigns the given resource the specified ID. It helps ensure
that when adding or removing resources, IDs are assigned in a stable
fashion.
If a package, type, or name is not found, no error or warning is
raised.
Change-Id: Ibc2f4e05cc924be255fedd862d835cb5b18d7584
diff --git a/tools/aapt2/ResourceUtils.h b/tools/aapt2/ResourceUtils.h
index 871ed7c..31b8e89 100644
--- a/tools/aapt2/ResourceUtils.h
+++ b/tools/aapt2/ResourceUtils.h
@@ -85,6 +85,11 @@
bool tryParseBool(const StringPiece& str, bool* outValue);
/**
+ * Returns an ID if it the string represented a valid ID.
+ */
+Maybe<ResourceId> tryParseResourceId(const StringPiece& str);
+
+/**
* Parses an SDK version, which can be an integer, or a letter from A-Z.
*/
Maybe<int> tryParseSdkVersion(const StringPiece& str);