summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceUtils_test.cpp
AgeCommit message (Collapse)Author
2020-01-13Fix serializing dynamic references to protoClark DuVall
The is_dynamic bit on references was getting lost when converting to proto and back. This was preventing bundles from being used as shared libraries, since layout inflation would fail when it hit a dynamic reference. Bug: 146491000 Test: Build a shared library with a layout that has a dynamic reference, and attempt to inflate that layout. Change-Id: Ia0e615670d2ac52f9266e3eec8813af7687d3323
2019-04-11qt-dev-plus-aosp designated for R. Update MAX_PLATFORM_VERSION, etc.Ryan Mitchell
Test: aapt2_tests Bug: 128934651 Change-Id: I179f7b92dcf65e77f039e6cd42d91bf5b1461e35
2019-03-06Fix aapt2 whitespace diffs from aapt(1)Ryan Mitchell
CDATA blocks were being processed differently in aapt2 so this change fixes aapt2 to not treat cdata blocks differently and still trime whitespace. Also, aapt did not process escapes when compiling xml files. This change removes over-processing of xml text nodes. All test strings are what aapt(1) would output. Test: aapt2_tests Bug: 124470332 Change-Id: I90ee0c1e5e9208f8a5c60cee93e3ba02712c9b2c
2019-01-16AAPT2: Add support for parsing codeNames with fingerprints.Nicholas Lativy
In addition to supporting manifest declared codenames of the form "[codename]", also support codenames of the form "[codename].[fingerprint]". Matches the behaviour of PackageParser as of ag/6056697. Test: ResourceUtils_test Change-Id: I814330eba9d383e4549e35da791fcfa9bd0cdf57
2018-06-22AAPT2: Fix unrecognized CDATARyan Mitchell
This change adds support for resources that have CDATA blocks within their values. The blocks should allow any character to occur without being escaped. It also should not effect the current state of quote processing. Bug: 80326349 Test: Created tests in aapt2_tests Change-Id: Ie1a00e50cffc877e2eb5f788f8d7a1bda839c0cf
2018-02-27AAPT2: Fix styled string whitespace processingAdam Lesinski
Change styled string whitespace processing to be like AAPT's was. Main changes: - whitespace around tags is preserved. - tags start exactly where they are supposed to, not off by one. Bug: 72406283 Test: make aapt2_tests Change-Id: I4d12728c493efd8c978e2e3d2718b56534ff52ef
2018-01-11AAPT2: Allow compatible duplicate AttributesAdam Lesinski
If a resource XML file defines two compatible Attributes, they should be merged without throwing an error. Ex: <declare-styleable> <attr name="conflict" format="string" /> </declare-styleable> <declare-styleable> <attr name="conflict" format="string|reference" /> </declare-styleable> In this case, string|reference and string are the same, so these should merge correctly. Bug: 65699599 Test: make aapt2_tests Test: make AaptBasicTest Change-Id: I7b0f956d2332f7f0b458acd59ca0a606b2cfdf95
2017-06-27AAPT2: Fix issues with parsing integers + floatsAdam Lesinski
If whitespace was present at the end of an integer or float, parsing would fail. Bug: 62902869 Test: make aapt2_tests Change-Id: I6c54f25ad73913d8ea90969fca9de24f726deb96
2017-06-09AAPT2: Clean up tests a bitAdam Lesinski
Since the latest gtest has fixed support for explicit bool operators, remvoe AAPT_ASSERT_* and AAPT_EXPECT_*. Also switch to use NotNull() matchers, which are more legible. Test: make aapt2_tests Change-Id: Idce199ca9d567d70f7aae275fee15e04bb914c9e
2017-06-02AAPT2: Allow undefined resources (placeholders)Adam Lesinski
A resource defined like so: <item type="drawable" name="foo" /> should be assigned the value @null. The only exception is for <string> resources, which are given the empty string value (since <string></string> is ambiguous). The decision to use "" is based off the fact that old AAPT used to assign "" to all undefined resources, even non-string ones. Bug: 38425050 Test: make aapt2_tests Change-Id: Ib3e0f6f83d16ddd8b279c9fd44a07a37867b85e9
2017-01-17Move StringPiece to libandroidfwAdam Lesinski
libandroidfw needs to make use of StringPiece, so move it to libandroidfw and update all code referencing StringPiece in aapt2. Test: make libandroidfw_tests libaapt2_tests Change-Id: I68d7f0fc7c651b048d9d1f5e7971f10ef5349fa1
2016-10-26AAPT2: Rename to match new styleAdam Lesinski
Use Google3 naming style to match new projects' and open source google projects' style. Preferred to do this in a massive CL so as to avoid style inconsistencies that plague legacy code bases. This is a relatively NEW code base, may as well keep it up to date. Test: name/style refactor - existing tests pass Change-Id: Ie80ecb78d46ec53efdfca2336bb57d96cbb7fb87
2016-10-19Use Google3 style guide with .clang-formatAdam Lesinski
Test: style change only, builds ok Change-Id: I885180e24cb2e7b58cfb4967c3bcb40058ce4078
2016-08-15AAPT2: Expose split support to command lineAdam Lesinski
Bug:30445078 Change-Id: If4b8530dba71b9059b8e62c04757da99c1119d22
2016-07-13AAPT2: Remove usage of u16stringAdam Lesinski
For legacy reasons, we kept around the use of UTF-16 internally in AAPT2. We don't need this and this CL removes all instances of std::u16string and StringPiece16. The only places still needed are when interacting with the ResTable APIs that only operate in UTF16. Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
2016-02-09AAPT2: Switch to protobuf for intermediate formatAdam Lesinski
Without needing to conform to the runtime data format, it is much easier to add new features such as debugging symbols and carrying over product data to link time. This also simplifies the runtime format parser and serializer, which will change much less frequently than the protobuf intermediate format. Change-Id: I209787bbf087db0a58a534cb8511c51d21133e00
2016-01-13AAPT2: Variety of small fixes to get the build workingAdam Lesinski
- Add option to rename package in AndroidManifest.xml - Support default versionName and versionCode - Accept True and False as valid booleans Change-Id: I400e350b9dcd0fd1c197d1929144299c7823617d
2015-12-17AAPT2: Fix references to private parentAdam Lesinski
Change-Id: Id4697551b6c8cb6167f562de593006ae3c6158c0
2015-11-19AAPT2: Fail compiling when private symbols are referencedAdam Lesinski
Also moved some XML specific stuff into its own directory, and refactored ReferenceLinker a bit. Change-Id: I912247a82023c1bbf72dc191fbdaf62858cbec0c
2015-11-16AAPT2: Be more strict parsing referencesAdam Lesinski
Change-Id: I3d54a519687fff1e66acb8e395ef99ba01a1b845
2015-10-16AAPT2: Separate out the various stepsAdam Lesinski
An early refactor. Some ideas became clearer as development continued. Now the various phases are much clearer and more easily reusable. Also added a ton of tests! Change-Id: Ic8f0a70c8222370352e63533b329c40457c0903e