Added a --zip flag similar to --dir that allows resources to be passed
into "aapt2 compile" using a zip file.
Also refactored Compile.cpp to be easier to mock and test in the future.
Bug: 74574557
Test: aapt2_tests
Change-Id: Idb90cb97e23a219525bdead38220cbf7bc6f3cab
Part of a refactor to specify sdk version for all <adaptive-icons> xml
resources.
Bug: 79676805
Test: build success
Change-Id: I1cf1109103722a9562eaf6bf2dcd68d0ef8757eb
The Android runtime and AAPT are more lenient of apk format, allowing
for duplicate enty, types, and configs. This change loosens the
ResourceTable's checks on resource uniqueness when apks are loaded; not
when ResourceTables are being created by aapt2.
Bug: 36051266
Test: Tested using apks in bug with allow_duplicates on and off
Change-Id: I9296417bf2dc53e1e891479a53679a0388210d50
If one sets a sufficiently long OUT_DIR to build into the
//frameworks/base:framework-javastream-protos generate target will
fail due to trying to run a too-long command. This works around that
problem by making the command being run much smaller.
Test: Build
Bug: 70221552
Change-Id: I0134ccfc83469826d3ea8679e1c52b9b52c6d2e0
Always take the original comment of a resource. Resources passed in
through regular file arguments and resources added using the -R and
--auto-add-overlay flags will keep the same comments when overlayed by
another resource.
This will allow R.java files to remain consistent across devices between
product overlays.
Bug: 70641212
Test: aapt2_tests
Change-Id: I4ed1037a8d42f7e77d85e5c2a8ee78051053831a
Adds flag --version-code-major that injects android:versionCodeMajor
into the manifest if none is present or when overriding.
Bug: 109883459
Test: aapt2_tests
Change-Id: I10b27abb8fa8a99a41976c42c4d684b99978b4f9
It's moving to a new home under art/tools, since it is needed by
branches which don't include frameworks/base.
Bug: 110868826
Test: Build master-art branch
Change-Id: Ice8324db52ae1e7e2ac6734e45874a66de935c9a
When writing a partial R file for the compiled file, only include
resources defined locally - meaning those without a package. Do not
write resources from other packages (e.g. "android").
Test: manual
Bug: 73927419
Change-Id: I84241352e643ca1f22a581e6847372e2a4278824
Annotation was added with name @UnsupportedAppUsage after Android API
council discussion.
Bug: 110868826
Test: m class2greylist
Change-Id: I63ad61e97c5e8fdebfcead9e4ee5b060a60f97c7
This reverts commit 481f027ddc.
Reason for revert: Not needed any more
Bug: 111543815
Test: existing unit and integration tests
Change-Id: I87b039192682636d81c2d33512495cb005c9504d
This extracts signatures of methods that have the @UsedByApps annotation
for generating the greylist. It will be integrated into the build to
replace many members on greylist.txt.
Test: $ atest class2greylisttest
Bug: 110868826
Change-Id: Ifaf5859b60076c051de6be5a912ef70734330ce7
This expands the Context+AttributeSet constructor specificity from only work on <view class=> nodes to <my.Type> nodes.
Bug: 37123156
Test: make aapt2_tests
Change-Id: I8fb950731383f86bee225333bda27baf5a7a34c5
- For transition and pathMotion attributes the method must have Context and AttributeSet parameters.
- For actionViewClass and actionProviderClass attributes the constructor must have a single Context parameter.
- For Fragment's class or name attributes the constructor must have zero parameters.
Bug: 37123156
Test: make aapt2_tests
Change-Id: I34017abd182867ba95172835051d114cb2f3b3ac
Test: m fontchain_lint
Test: m
Test: Visual test on device after full build
Bug: 110037531
Change-Id: Iac26c7c7c0e1a8a500a93f19d99831113529b201
(cherry picked from commit 77a1b14910)
This attribute was added in API 28 and is reflectively instantiated from a zero-argument constructor.
Test: make aapt2_tests
Change-Id: Ie9de0764165c6fe6c6fcda6cc38b0cc633f03bbd
We're starting to see "@interface" show up, so handle them like any
other interface. We're also seeing more details argument lists
with names and annotations; ignore them for now, since all our
existing lint checks work on the "real" data type.
Verified that it handles new support library current.txt files
without causing any regressions against existing framework
current.txt files.
Test: manual inspection
Bug: 111555356
Change-Id: Id11c3561edd317e4ba1a9b43993fd96d8243e00d
Refactoring areas in AAPT2 that use android:versionCode to also use
abdroid:versionCodeMajor. Does not add versionCodeMajor command line flag yet.
Bug: 109883459
Test: aapt2_tests
Change-Id: I573fbea37491cf8c5742f9e385c66ee64c4e5166
Refactors the flag based command invocation into classes that make using
subcommands easier.
Test: manual tests of printing
Change-Id: Ic8df6af0be30db552e32150afebecbfeec7e1075
When generating the R.java file, attributes of styleables do not always
have package names on them. This caused a problem where when an apk
that was previously linked and that also contained a declare-styleable
is linked again to an AndroidManifest.xml with a different package name,
styleable attributes' resource symbols could not be looked up correctly.
This change does not rename the resources but makes sure that the java
generator finds the attribute symbols correctly.
Bug: 110877419
Test: Created a test in aapt2_tests and verified correct behavior of
repro example from bug
Change-Id: Ib99d84cbe44dadca86603bc610ad3f4e09e3fb11