Now that AAPT2 is library-aware, it needs to take care of
all library related work, including merging manifests.
The logic was taken from the current Java ManifestMerger.
Change-Id: Id93f713f27ae8617922bf89e325e45be9f863c06
We modify the XML of layouts and AndroidManifest enough
that it warrants we operate on the tree in memory.
These files are never very large so this should be fine.
Change-Id: I5d597abdb3fca2a203cf7c0b40fcd926aecb3137
@null must be encoded as TYPE_REFERENCE with a value of
0. TYPE_NULL is used by the runtime as a placeholder when resolving
style attributes. If we set a style attribute to TYPE_NULL,
the runtime will throw. The runtime will convert a TYPE_REFERENCE
with value 0 to a proper null value.
Change-Id: Id983ca7e1fbee3124dddafe32f1b5741b824225b
When a static library A references static library B,
and app C references both A and B, we get the following symbol merging,
symbols from library B get imported twice.
We must only check that symbol references to library B are valid
when building library A. We should only merge all the symbols
when building final app C.
Change-Id: I23cba33b0901dcbb5328d9c9dfaa6a979c073c36
Difference between normal app and static library is that
the R file uses non-final fields, and the extra chunks added
by AAPT2 remain in the final APK.
Change-Id: I61416387ca9bb3c21857ff7cfab5847ac3edf57a
This allows us to store the source and comments of a resource's
public declaration and avoids issues where there is no default
configuration for a publicly declared resource (like with drawables
of various densities) and AAPT2 mistakenly took this as an error.
Change-Id: I07a2fe9f551daefcce842f205fb219d2fa453ebc
Previously, you could only reference namespace prefixes in attribute names:
<View xmlns:appcompat="http://schemas.android.com/apk/res/android.support.v7.appcompat"
appcompat:name="hey"
...
Now you can also reference them in resource names within an attribute value:
...
android:text="@appcompat:string/confirm"
...
Which will be treated as "@android.support.v7.appcompat:string/confirm".
Change-Id: Ib076e867a990c80cf877a704eb77cd1ef0b23b52
Makefile that uses zip for assembling the final APK. This is temporary and
helps speed up the rest of development.
Has to add a new 'manifest' phase that simply compiles the AndroidManifest.xml.
Manifests are handled differently and must be validated.
Change-Id: I0d8255b3ad0d0b0a322683077e3331ca93e37fa0
This is incomplete. Still requires:
- filling in layout information in the resulting .bind.xml
- processing elements with <view class=""/>
- processing imports
Change-Id: Ie5d4c5e6435591bbed3248129a548736244894eb
First checking of AAPT2. The individual phases of AAPT2 work, but there
are some missing pieces.
For early testing we are missing:
- Need to properly mark file references and include them in package
- Need to package into zip
Final AAPT for apps we are missing:
- Need to crush PNGs
- Need to parse 9-patches
- Need to validate all of AndroidManifest.xml
- Need to write align method to align resource tables for splits.
Final AAPT for apps + system we are missing:
- Need to handle overlays
- Need to store comments for R file
- Need to handle --shared-lib (dynamic references too).
New AAPT features coming:
- Need to import compiled libraries
- Name mangling
- R file generation for library code
Change-Id: I95f8a63581b81a1f424ae6fb2c373c883b72c18d