History log of /frameworks/base/tools/aapt2/ResourceUtils.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9beaa9cfe3bd8c7c59eed053ff6ca18951c34a86 29-Mar-2018 Ryan Mitchell <rtmitchell@google.com> Changed AAPT2 to abide by AAPT resource whitespace triming.

Bug: b/74331008
Test: Created tests in ResourceParser_test.cpp
Change-Id: Id7b387692b795774cd77452ca8cf06a8447bf3be
(cherry picked from commit a04880771254f5169a1fe460ff40b565d9dceb0d)
/frameworks/base/tools/aapt2/ResourceUtils.cpp
2eed52ecc0c2fa3e96530e4b5556eaa82f7c2dfc 22-Feb-2018 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix styled string whitespace processing

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
/frameworks/base/tools/aapt2/ResourceUtils.cpp
d05b9130fdbff8062084b566a380c5b058273d75 15-Feb-2018 Shane Farmer <safarmer@google.com> AAPT2: Fix compatible-screens element in AndroidManifest.xml

Fix an issue where the compatible-screens element was not being
populated correctly. The previous version was missing the screenSize
attribute which is mandatory. The attributes were also missing the
resource ID from the framework library as these are a part of the public
API.

Change-Id: I2f594c2259831dbbd96c58db4ba55e8288d4231e
Test: unit tests
Test: manually split an APK and dumped with aapt
/frameworks/base/tools/aapt2/ResourceUtils.cpp
70fdf76c52224217179529be868c47b3194f1551 27-Nov-2017 Pierre Lecesne <lecesne@google.com> AAPT2 - Make raw files of type unknown.

Bug: 69791607
Test: Manual.

Change-Id: I6ee5ef37fb447ab79d46b57e0dc4eaad84eec723
/frameworks/base/tools/aapt2/ResourceUtils.cpp
e59f0d80ec19249f72c07ae191ad673d040443e3 13-Oct-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Enable building proto artifacts

- This will allow the bundle tool to ingest the outputs of the aapt2 link
phase.

Bug: 64143208
Test: manual
Change-Id: I1a4b3ce5c2ffbbdc4bc642c3371a9ef2e7e9ad71
/frameworks/base/tools/aapt2/ResourceUtils.cpp
4670805ea441edb8b280f9312571e7799f1284cf 29-Sep-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Move format related files under same directory

Test: make aapt2_tests
Change-Id: Id72cdfc12ba3add294048e60c55f2461344464bf
/frameworks/base/tools/aapt2/ResourceUtils.cpp
060b53d0287f9e685fb5b49b52a864ef85315a22 29-Jul-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Ensure style strings are always first in StringPool

Move the styled strings to a separate section of the StringPool so
that sorting can never mess up the order of Styles.

Bug: 63570514
Test: make aapt2_tests
Change-Id: Id2ce1355b92be1bb31ce0daa7e54ae9b5b6c2ffe
/frameworks/base/tools/aapt2/ResourceUtils.cpp
8a3bffea4926aa691ea1fbc0e7b67ed954e83d2c 27-Jun-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix issues with parsing integers + floats

If whitespace was present at the end of an integer or float, parsing
would fail.

Bug: 62902869
Test: make aapt2_tests
Change-Id: I6c54f25ad73913d8ea90969fca9de24f726deb96
/frameworks/base/tools/aapt2/ResourceUtils.cpp
bab4ef56d7803f3a50ccfaca2729509338fcbb23 02-Jun-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Allow undefined resources (placeholders)

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
/frameworks/base/tools/aapt2/ResourceUtils.cpp
5924d8c9ab7bd8614e8bd99864903ce9d50f3bf7 31-May-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Allow merging of Style attributes from overlays

Previously style overlays would completely override an existing style.
To be compatible with AAPT, styles now merge with the overlay, allowing
the overlay's attributes and parent to take precedence.

Bug: 38355988
Test: make aapt2_tests
Change-Id: Id25c7240050a43e6a4a177c6e3d51e048d0cceb5
/frameworks/base/tools/aapt2/ResourceUtils.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/ResourceUtils.cpp
b5dc4bd49a036e3403ca17e961d2c8e13e038295 23-Feb-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Few tweaks to get shared-libraries working

Test: manual (building shared support library demo)
Change-Id: I4730645aa92ba1893baf67ffe35fbd4aac0f8e46
/frameworks/base/tools/aapt2/ResourceUtils.cpp
ceb9b2f80f853059233cdd29057f39a5960a74ae 16-Feb-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Shared library support

Test: make aapt2_tests
Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
/frameworks/base/tools/aapt2/ResourceUtils.cpp
929d6517dfd338f0d481dbe6587643d5aef27ec6 17-Jan-2017 Adam Lesinski <adamlesinski@google.com> AssetManager2: Add GetResourceId

Add ability to lookup a resource by name.

Test: make libandroidfw_tests
Change-Id: I262ba5ce4c9892458226fbdb44cf21f9877fb92d
/frameworks/base/tools/aapt2/ResourceUtils.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/ResourceUtils.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/ResourceUtils.cpp
cacb28f2d60858106e2819cc7d95a65e8bda890b 19-Oct-2016 Adam Lesinski <adamlesinski@google.com> Use Google3 style guide with .clang-format

Test: style change only, builds ok
Change-Id: I885180e24cb2e7b58cfb4967c3bcb40058ce4078
/frameworks/base/tools/aapt2/ResourceUtils.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/ResourceUtils.cpp
1d740812e657e92e5370b4162991a7e43ec43221 15-Aug-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "AAPT2: Expose split support to command line"
36c73a595910e96f3552f938eeb81d46356067a1 11-Aug-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Expose split support to command line

Bug:30445078
Change-Id: If4b8530dba71b9059b8e62c04757da99c1119d22
/frameworks/base/tools/aapt2/ResourceUtils.cpp
9b8528fee4eed35b8e887ded0851d08eb2b10db6 10-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in aapt and aapt2.

* Add explicit keyword to conversion constructors.
* Add NOLINT(implicit) comments for implicit conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1

Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
/frameworks/base/tools/aapt2/ResourceUtils.cpp
bf0bd0f9ac1ffa0231cff0f6591dede48b3c6d52 02-Jun-2016 Adam Lesinski <adamlesinski@google.com> 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
/frameworks/base/tools/aapt2/ResourceUtils.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/ResourceUtils.cpp
fb6312fe93a8544e6a95d1c619c8cea3940cbe1a 28-Jun-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Add version collapsing

When an app specifies (or imports) resources with various
configurations for different SDK versions, specifying
a minSdk will make many of those resources unreachable.

Version collapsing will prune out the resources specified
for SDK versions less than the minSdk.

If, however, there is no exact matching resource for the
minSdk version, the next smallest SDK version is kept.

Change-Id: Ic7bcab6c59d65c97c67c8767358abb57cdec60a4
/frameworks/base/tools/aapt2/ResourceUtils.cpp
458b877488c12ea4336d8fc00a95d9c0298bd6d0 25-Apr-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Add diff command

Adds the diff command and various small fixes to issues
discovered when diffing old AAPT built APKs with new AAPT2
built APKS.

Bug:22775504
Change-Id: I682a7fe1cf4b3efa7cbd5d18b333cf2d1046fe1b
/frameworks/base/tools/aapt2/ResourceUtils.cpp
59e04c6f92da584b322c87072f18e6cab4de4c60 05-Feb-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Switch to protobuf for intermediate format

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
/frameworks/base/tools/aapt2/ResourceUtils.cpp
52364f7ae31716d7827ea8f8566f4a28bd30a921 11-Jan-2016 Adam Lesinski <adamlesinski@google.com> AAPT2: Variety of small fixes to get the build working

- Add option to rename package in AndroidManifest.xml
- Support default versionName and versionCode
- Accept True and False as valid booleans

Change-Id: I400e350b9dcd0fd1c197d1929144299c7823617d
/frameworks/base/tools/aapt2/ResourceUtils.cpp
24b8ff0faf7c59323d0171cdd825ca09e712aa1e 16-Dec-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix references to private parent

Change-Id: Id4697551b6c8cb6167f562de593006ae3c6158c0
/frameworks/base/tools/aapt2/ResourceUtils.cpp
a6fe345be955368a13aea76aefb4db821aad11df 10-Dec-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix overlay support

Supports the <add-resource> tag and mimics old AAPT behavior of
not allowing new resources defined unless <add-resource> was used
or --auto-add-overlay was specified.

Change-Id: I9b461137357617ade37fd7045b418b8e6450b9c4
/frameworks/base/tools/aapt2/ResourceUtils.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/ResourceUtils.cpp
7298bc9c857541b444b2f1639dbed17599cbe5e9 16-Nov-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Be more strict parsing references

Change-Id: I3d54a519687fff1e66acb8e395ef99ba01a1b845
/frameworks/base/tools/aapt2/ResourceUtils.cpp
b23f1e077b02a1d62bcf5e34655e8dc979e124fa 03-Nov-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Verify positional Java String format arguments in strings

Change-Id: Id415969035a0d5712857c0e11e140155566a960c
/frameworks/base/tools/aapt2/ResourceUtils.cpp
2ae4a877d1623f851040ce69239552c873f1abf0 03-Nov-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Add Manifest fixing/validation

Change-Id: I7f6d8b74d1c590adc356b4da55cb6cb777cdf1da
/frameworks/base/tools/aapt2/ResourceUtils.cpp
1ab598f46c3ff520a67f9d80194847741f3467ab 14-Aug-2015 Adam Lesinski <adamlesinski@google.com> AAPT2: Separate out the various steps

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
/frameworks/base/tools/aapt2/ResourceUtils.cpp