summaryrefslogtreecommitdiff
path: root/tools/aapt2/format/binary/XmlFlattener_test.cpp
AgeCommit message (Collapse)Author
2021-04-28Add <macro> tag to aapt2Ryan Mitchell
AAPT2 Macros are compile-time resources definitions that are expanded when referenced during the link phase. A macro must be defined in the res/values.xml directory. A macro definition for a macro named "foo" looks like the following: <macro name="foo">contents</macro> When "@macro/foo" is used in the res/values directory or in a compiled XML file, the contents of the macro replace the macro reference and then the substituted contents are compiled and linked. If the macro contents reference xml namespaces from its original definition, the namespaces of the original macro definition will be used to determine which package is being referenced. Macros can be used anywhere resources can be referenced using the @package:type/entry syntax. Macros are not included in the final resource table or the R.java since they are not actual resources. Bug: 175616308 Test: aapt2_tests Change-Id: I48b29ab6564357b32b4b4e32bff7ef06036382bc
2019-10-17Allow for RRO internal referencingRyan Mitchell
This change allows RROs to reference their own internal resources as expected. Overlays are loaded as shared libraries so they can have their own resource id space that does not conflict with the resource id space of the target or other overlays. References to overlay resources that override target resources now appear as references to the target resources. Overlay values that are inlined into the xml file specified using android:overlayResources are now able to be used at runtime. See go/rro-references for more information. Bug: 135943783 Test: idmap2_tests Test: libandroidfw_tests Change-Id: Ie349c56d7fd3f7d94b7d595ed6d01dc6b59b6178
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
2018-05-02AAPT2: Fix quoted text in res/xml assetsRyan Mitchell
AAPT2 aggressively processed xml nodes and regressed from the behavior of AAPT. This change restores AAPT's processing of xml nodes with quotations. Bug: 71805084 Test: Created tests in XmlFlattener_test.cpp and ran the test in the Android Studio project given in the bug Change-Id: Idedb4f1002e9fd705ceb5feae35289235b754b02
2018-02-23AAPT2: Fix issue with String flattening in XmlFlattenerAdam Lesinski
Compiled Strings (previously not encountered) in an XML resource were using a different StringPool than the one being referred to in the XmlFlattener, and so the indices were all wrong. Bug: 72700446 Test: make aapt2_tests Change-Id: I663924f8fad50fd4c69cfa196318dc63fb641a25
2017-10-04AAPT2: Move format related files under same directoryAdam Lesinski
Test: make aapt2_tests Change-Id: Id72cdfc12ba3add294048e60c55f2461344464bf