History log of /frameworks/base/tools/aapt2/xml/XmlDom.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0da683bd8da55a0cfa46dfe8076b729b945d6650 03-Oct-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Preserve line numbers when deserializing from binary XML

Bug: 65827146
Test: make aapt2_tests
Change-Id: Idbfea640eb8727fe209ebc6eb072296845d9f282
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
5c33fb5408d6c02dc2c73f53d89d1494fe04f208 09-Aug-2017 Adam Lesinski <adamlesinski@google.com> 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
Bug: 65645766
Change-Id: Ib97ff1c4252b7907e2cc1f13a448dc4ca3b809a4
Merged-In: Ib97ff1c4252b7907e2cc1f13a448dc4ca3b809a4
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
5b54ca2d72c410aa34363b0f3bb0fe1666954aea 02-Aug-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix windows unicode path issues

Mingw64 was being difficult, so instead of defining a wmain entrypoint,
the command line parameters are parsed manually using built-in Windows
methods that support Unicode. The results are converted to UTF8 and
handled just like the rest of the linux/mac version of the code.

This also removes dependencies on std::istream in favour of a
FileInputStream which calls the appropriate unicode version of
open to read a file.

No speed regressions found on Linux or MacOS.

Bug: 62336414
Bug: 63830502
Bug: 65645766
Test: manual
Change-Id: I597da51e33729ed1b98bf246e7e773337fd3fee8
Merged-In: I597da51e33729ed1b98bf246e7e773337fd3fee8
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
c744ae8aca97edfb2422598ea620e8219449fa9b 18-May-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Implement attribute compat versioning

This change defines some hardcoded rules to degrade
attributes in newer SDKs to specific older attributes.

An attribute with a degrade rule will generate a new XML for the API
in which the attribute resulting from the degradation was introduced.

Since API 22 (Lollipop MR1), attributes are correctly ignored and do
not need to be versioned. In XML files defined for APIs 22+, the
original and degraded attributes coexist in the same XML file.

One such example is paddingHorizontal, introduced in API 26.
paddingHorizontal degrades to paddingLeft and paddingRight, which
were both introduced in API 1.

Bug: 35763493
Test: make aapt2_tests
Change-Id: I4aa8755a9ee2c0cc5afdc55c3d30093fd3a47f3d
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
48448e8a310e72eb2846ad0f86672ce4f0b47e47 27-Apr-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix string escaping

We were processing escaped strings too early, before
parsing of values into types. Now the escaped strings get
processed when they are being flattened.

Bug: 37715376
Test: make aapt2_tests
Change-Id: Ic59aa2e3a20c40756c219752ff74b2a4f8a602ba
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
ea134e08d70d156bdd17714d5f9ab9c44c91d4fa 13-Apr-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix order-of-destruction crash

Make sure that users of StringPool are destroyed before
the StringPool itself.

Test: valgrind aapt2 optimize -o opt.apk out/target/common/obj/APPS/framework-res_intermediates/package-export.apk
Change-Id: I140c2d32f8449028976795d5d6865d83e1409b53
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
d0f492db038c6210c1138865d816bfb134376538 04-Apr-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Share split functionality between link and optimize

Generating splits should be possible to do from the optimize command.
This means that a lot of infrastructure around split APKs can be
shared by both the optimize and link phase.

Bug: 35925830
Change-Id: Ia88b9e4bff300a56353b2f7a4a2547c8eb43a299
Test: manual
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
ac6edc501b61e14e3b70ccbbd4d8ed112d92b96c 03-Mar-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix escaping sequence processing in XML parsing

Bug: 35483813
Test: make aapt2_tests
Change-Id: I68baba17ab3639c220b734a2a68d86aad0dedf8c
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
d5083f6f6b9bc76bbe64052bcec639eee752a321 17-Jan-2017 Adam Lesinski <adamlesinski@google.com> Move StringPiece to libandroidfw

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
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
e343eb145c42d00c4fd3fdde93cd0be55cb5b855 28-Oct-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Insert <uses-sdk> element before <application>

PackageParser on the device uses the targetSdkVersion of the
app while it parses <application>. That means that if the
<uses-sdk> tag comes after <application>, the targetSdkVersion
is assumed to be 0.

Test: make libaapt2_tests
Change-Id: I60f2179a7ff44e7419217afb53f3d24f8c030f6e
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
ce5e56e243d262a9b65459c3bd0bb9eaadd40628 22-Oct-2016 Adam Lesinski <adamlesinski@google.com> 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
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
5eeaaddffd23d8d85aeb321e3ceea626e42cf9de 25-Aug-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Add Inline Complex XML support

See: https://developer.android.com/guide/topics/resources/complex-xml-resources.html

Change-Id: I8274c85e25cabf90423141c228697e873167d136
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
d0f116b619feede0cfdb647157ce5ab4d50a1c46 09-Jul-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Remove usage of u16string

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
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
803c7c807969bea1f1c50f348832f5b60ad05d8e 07-Apr-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Enable windows build and make sure it builds

Mingw32 4.8 is kind of picky with macros and some complicated template
stuff. Luckily there was another way to represent the
SFINAE code that works on all platforms. Yay!

Change-Id: Idc2e38f47bfdc57b394550bfa0f53cc0b825df25
/frameworks/base/tools/aapt2/xml/XmlDom.cpp
467f171315f9c2037fcd3eb5edcfabc40671bf7b 17-Nov-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Fail compiling when private symbols are referenced

Also moved some XML specific stuff into its own directory,
and refactored ReferenceLinker a bit.

Change-Id: I912247a82023c1bbf72dc191fbdaf62858cbec0c
/frameworks/base/tools/aapt2/xml/XmlDom.cpp