Commit Graph

9 Commits

Author SHA1 Message Date
Adam Lesinski
c9a2926e66 AAPT2: Allow to inline XML into custom attribute
Previously, doing something like

<parent xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:aapt="http://schemas.android.com/aapt">
    <aapt:attr name="app:foo">
        <child />
    </aapt:attr>
</parent>

would result in something like:

<parent xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:aapt="http://schemas.android.com/aapt"
        foo="@generated_name" />

while it should result in:

<parent xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:aapt="http://schemas.android.com/aapt"
        app:foo="@generated_name" />

Bug: 36809755
Test: make aapt2_tests
Change-Id: I72ea4b402e196ca05b53b788e4768a265190a0dc
2018-03-01 20:04:00 -08:00
Adam Lesinski
93190b79d1 AAPT2: Better debugging output
Test: make aapt2_tests
Change-Id: I7778b773201381538dc1f2e376abee4eb33e44c0
2017-11-07 11:21:10 -08:00
Michael Wachenschwanz
7b6b02bd13 AAPT2: Allow for nested inline xmls
Add recursion to InlineXmlFormatParser::Consume for handling nested
aapt:attr

Change-Id: Iabf98945b4f5ef22a3b8fdc4ca2bac092a377629
Fixes: 64385167
Test: make aapt2_tests
2017-10-31 11:02:48 -07:00
Adam Lesinski
461c80573b AAPT2: Fix issue where generated XML would be tagged with UNKNOWN type
CompiledFiles with UNKNOWN type are copied through, leading to protobuf
outputs in the final APK.

Test: make aapt2_tests
Change-Id: Ia0c464caa3951ff27436d1d50c2a8555bc89302b
2017-10-26 17:18:19 -07:00
Adam Lesinski
1ef0fa9d72 AAPT2: Fixup namespace implementation
A few pieces were missing in the namespace mangling implementation.
Namespace aware libraries now work, along with R class generation.

Bug: 64706588
Test: make AaptTestNamespace_App
Change-Id: I12f78d6aa909e782c0faf7ceaa36058f2e6c864a
2017-08-23 11:30:54 -07:00
Adam Lesinski
6b37299129 AAPT2: Change XmlDom to exclude Namespace as a node
In preparation for exporting an XML proto format for UAM to consume,
this change brings the XML DOM API more in line with other APIs that
do not make the Namespace a separate node.

Treating Namespace declarations as just properties of an Element
node makes the implementation of algorithms much simpler, as
the constraints that Namespace nodes have only one child
are now built in and traversing to find Element nodes
is much simpler.

Also made a bunch of quality of life improvements, like formatting and
comment style.

Test: make aapt2_tests
Change-Id: Ib97ff1c4252b7907e2cc1f13a448dc4ca3b809a4
2017-08-17 17:43:08 +00:00
Adam Lesinski
ce5e56e243 AAPT2: Rename to match new style
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-26 19:30:23 -07:00
Adam Lesinski
cacb28f2d6 Use Google3 style guide with .clang-format
Test: style change only, builds ok
Change-Id: I885180e24cb2e7b58cfb4967c3bcb40058ce4078
2016-10-19 12:18:14 -07:00
Adam Lesinski
5eeaaddffd AAPT2: Add Inline Complex XML support
See: https://developer.android.com/guide/topics/resources/complex-xml-resources.html

Change-Id: I8274c85e25cabf90423141c228697e873167d136
2016-08-31 18:32:34 -07:00