LOCAL_STATIC_JAVA_AAR_LIBRARIES are slightly different from
LOCAL_STATIC_ANDROID_LIBRARIES, due to b/78447299 the
AndroidManifest.xml from ANDROID libraries are ignored.
Temporarily add support for LOCAL_STATIC_JAVA_AAR_LIBRARIES
when using LOCAL_USE_AAPT2 := true, treating them the same
as LOCAL_STATIC_ANDROID_LIBRARIES except that they are
merged by android_manifest.xml
Bug: 78447299
Bug: 79481102
Test: m FORCE_AAPT2=true checkbuild
Change-Id: Ia6210810c1ea6e776be97ae1c9a586b5de844125
Fix some incorrect dependencies after I12d33e52019aebac6ea33271939228e4690a4173.
Bug: 73885582
Test: m java FORCE_AAPT2=true
Change-Id: Ica2758991603e1605f629d843d19df5e2ef4fae1
If a static android library lib1 has LOCAL_STATIC_ANDROID_LIBRARIES
lib2, then the R.class files for packages in lib2 will be merged
into the jar for lib1. If an app has lib1 in its
LOCAL_STATIC_ANDROID_LIBRARIES it will get the R.class files from
lib2 through lib1, instead of regenerating the R.java files with
numbering that matches the resource table of the app.
This was worked around for support libraries by keeping a
fix_dependencies.mk that added transitive static support libraries
to the direct static dependencies of apps. Instead, propagate
the packages that aapt2 generated R.java files for up as
--extra-packages arguments to the next aapt2 invocation, which
will force aapt2 to regenerate the R.java files for those packages.
Bug: 78300023
Test: m checkbuild
Change-Id: I7375e13241b4c4f2933032409fb7935abe133bfc
Dumping files in the *_intermediates/src causes incremental build
problems, because we don't know when to delete them if they are
no longer generated. Switch to outputting a srcjar instead, and
pass it in to the turbine and javac compiles.
Bug: 73885582
Test: m checkbuild
Change-Id: Ibef28507522339d930c09426d0c98372eb864cb6
Merged-In: Ibef28507522339d930c09426d0c98372eb864cb6
(cherry picked from commit 2d1cddd567)
Use zipsync instead of extract_srcjars.sh.
Also fixes an issue where unzipping a resource zip would
ignore anything that wasn't a *.java file.
Bug: 73885582
Test: m checkbuild
Change-Id: I1c25f65afa196614879071c8655866febebac185
Allow aapt2 rules to take zipped resource files similar to the
way the javac rules take srcjars. For now, unzip the files using
extract_srcjars.sh, and then use aapt2 compile --dir. Eventually
it could be done with aapt2 compile --zip.
Bug: 73885582
Bug: 74574557
Test: m checkbuild
Change-Id: I97ea3ff305e7a9ef2a908b4cf0bca903af62c6b1
my_generated_res_dirs wasn't being reset in some cases in between
different modules. To be safe, clear every input variable that I was sure
was not being used by the caller after aapt2.mk.
Test: m
Test: m ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Change-Id: I37c861d99637cad77a2a378a119bf66cee373b3a
PRODUCT_AAPT2_CFLAGS and PRODUCT_AAPT_FLAGS are only used to pass
--pseudo-localize. The flag doesn't need to be conditional on the
product, because the pseudo locale will be stripped out later if it
is not wanted. Having it conditional on the product causes the
AAPT2-compiled resources to vary between products, which causes
unnecessary rebuilds when swithcing products.
Remove the variables, always add --pseudo-localize, and move
the AAPT2 compiled output to the common intermediates.
Test: m checkbuild
Change-Id: Iacc914114616b5bd19d9a1011802f4f9bca9bc19
Make R.stamp actually part of the same rule that creates R.java.
Otherwise if the generated sources directory is removed, we don't
regenerate R.java / Manifest.java.
Also move the package-export.apk and proguard options file into the same
rule.
Test: m telephony-common; rm out/target/common/obj/*/*_intermediates/src; m telephony-common
Change-Id: I71f6fcaf20593ca23271d52d15537aaa9ef4cc77
Although performing the inclusion of assets/ at a later stage is
preferable, (since aapt just copies the files) do the easy thing and
support what aapt did. In the future perhaps we can zip up the
assets/ directories when also merging in the classes.dex.
Bug: 35461578
Change-Id: I7d7fde43333ea6455c4a1b9113bd25e1d88b7dd5
Test: manual
This reverts commit 996bc3ce7b.
Reason for revert: Need to update prebuilts, but prebuilts not built by server yet...
Change-Id: I87deb3ed9512278ff40c185059230dbd66524989
Although performing the inclusion of assets/ at a later stage is
preferable, (since aapt just copies the files) do the easy thing and
support what aapt did. In the future perhaps we can zip up the
assets/ directories when also merging in the classes.dex.
Bug: 35461578
Test: manual
Change-Id: I7cd36585e7c292e43b5528969900c6ead2b80c0b
AAPT2 allows the declaration of a split path, so that build systems
don't need to guess the auto-generated name.
Construct the split path we want from the configurations passed in to
LOCAL_PACKAGE_SPLITS.
Bug:30445078
Change-Id: I06a4148b283d0c6751751ba116e9482c3a6eae5d
- Restore old ordering of resource files to match AAPT behavior
- Change the order in which overlays are processed.
Change-Id: I9da88f6b4124e7f89a70eb485b4591d5c4c87d38
- Switch to static library's package-res.apk as the link artifact.
- For prebuilt AAR file, build package-res.apk using aapt2's "--dir"
option.
- New LOCAL variables:
LOCAL_USE_AAPT2: a module can opt-in with "LOCAL_USE_AAPT2 := true".
LOCAL_STATIC_ANDROID_LIBRARIES: static Java libraries with compiled
resources.
LOCAL_SHARED_ANDROID_LIBRARIES: shared Java libraries with compiled
resources.
Bug: 25958912
Change-Id: I4be2d1e8137555986338c2583cb39b0c97391751
AAPT2 does pseudo-localization in compile phase. Passing --pseudo-localize
to the link phase causes an error.
Bug:25958912
Change-Id: I6ced0979884cb0d718018f995f9b2f6476d401cb
To build with AAPT2, set "USE_AAPT2=true".
TODO: Support split apks and generated resources from other than renderscript.
Bug: 25958912
Change-Id: I19b1a038824ce5b2a3d3ffadbce3173c845193fc