If profile guided dexpreopt _and_ optimization/obfuscation is true, then
apps must use the rewritten profile created by r8/d8
Bug: 335418838
Test: m nothing --no-skip-soong-tests
Change-Id: Iac45b614f43e52ac40ad1d13df0338bcafa788c3
Currently, dexpreopt supports profile guided optimization. This does not
work well with r8/d8 optimization, since the checked-in profile will not
match the dex signatures after r8/d8 has optimized the dex code.
This CL introduces a new property `dex_preopt.enable_profile_rewrting`.
If set, the checked-in profile will passed as `input` to r8 via
`--art-profile <input> <output>`. The <output> from the previous command
will be used as the profile for dexpreopt.
Test: m nothing --no-skip-soong-tests
Test: m CredentialManager with https://ag.corp.google.com/27448930
and obfuscation turned on
Test: nm -U symbol.odex # contains obfuscated methods
Bug: 335418838
Change-Id: I53beed9ed76f013262f1c503de0f2b74997c2a7f
Since we will not shrink the resources anyway this is a waste of time
Bug: 338429777
Test: m SystemUI
Change-Id: I388f045294131a304920756607792091627921bc
If the flag is set we will:
- pass --optimized-resource-shrinking to the r8 invocation
- use non final fields for the generated R classes
- not pass the aapt2 generated proguard rules, R8 will do the tracing of xml files
Bug: 325905703
Test: This is simply passing the flag through to R8, this is off by default
Change-Id: Ib2043f3201578c3bcd39c1de9a524fd78f6d795c
Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider
to use the type-safe android.OtherModuleProvider API.
Bug: 316410648
Test: builds
Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5
This reverts commit b82a2a278b.
Reason for revert: DroidMonitor: Potential culprit for multiple Module failures on ATH. verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.”.
Change-Id: I3899a45cce259c4ee38572e76f4735eccb3ca66a
Java libraries were writing lists of files that changed whenever
transitive dependencies changed to Android-${TARGET_PRODUCT}.mk, causing
Kati analysis to rerun whenever a dependency was changed in Soong.
In both cases, Make would immediately use the list to write a single
output file. Write the files in Soong and pass the path to the file
to Make instead, which will both reduce the size of
Android-${TARGET_PRODUCT}.mk and skip Kati analysis more often.
Bug: 309006256
Test: m checkbuild
Change-Id: I5dff16c6fb7cca8c6da927b37c612c7b1d0954e6
This reverts commit a9fd59a7f2.
We are moving the resource shinking pipeline into r8 (gennerally, not just for platform)
This disables the usage of the resource shrinker cli from cmd-line tools
There are no changes in this cl compared to the original land, the fix
was done in R8 (to use the same compression for res folder entries as
in the original)
Bug: 308710394
Bug: 309078004
Test: Existing, validated that resource table on SystemUI was byte<>byte equal, validated uncompression
Merged-In: Ib8a6fb128084e994325b975c46a036cb41494654
Change-Id: Id45b170dd50f75bc87e21ad03b2d0679efb7adc2
We are moving the resource shinking pipeline into r8 (gennerally, not just for platform)
This disables the usage of the resource shrinker cli from cmd-line tools
Bug: 308710394
Test: Existing, validated that resource table on SystemUI was byte<>byte equal.
Change-Id: Ia36b5e5970cbdcff519a5f05d672b44dc145ea32
Only android_apps were actually applying transitive proguard flags files
to their r8 invocation. This CL ensures that this also occurs for
installable android_libraries and java_libraries.
Bug: 302342049
Test: go test ./java
Change-Id: Ie94d688d04367ee3d39e7e760fb3003df5829951
The withres-withoutdex files were added in b/195558228 because D8
produced errors when given an input jar that contained both class
and dex files:
Error: com.android.tools.r8.internal.Cc: Cannot create android app from an archive 'out/soong/.intermediates/libcore/libcore-crypto-tests/android_common/withres/libcore-crypto-tests.jar' containing both DEX and Java-bytecode content
It turns out R8 doesn't have this problem, it defaults to ignoring *.dex
files unless the com.android.tools.r8.allowDexInputToR8 system property
is set. Remove the withres-withoutdex files when using R8, but keep
it in place for D8 for now.
Bug: 302573555
Bug: 303264288
Bug: 303064127
Test: m checkbuild
Test: m Calendar && m Calendar
Test: m framework-minus-apex && m framework-minus-apex
Change-Id: Ib6410f7fef6faf5913476c6423cdd27215c68c45
R8 rules produce a depfile generated by R8. R8 sees the withres-withoutdex
jar as an input, and so adds it to the depfile. If the jar is deleted
after running R8 then ninja will always consider the rule dirty, as the
input file listed in the depfile is missing.
Fixes: 303064127
Test: m Calendar && m Calendar
Test: m framework-minus-apex && m framework-minus-apex
Change-Id: I5cbd780b56fc131b58598d6e569a8a78b7fe9395
Delete files created within the d8 and r8 rules that are not considered
output files by ninja. This should reduce disk space usage without
affecting incremental build performance.
Bug: 302573555
Test: m checkbuild
Change-Id: Ifea86888c2f385415735ade7d80cf315bc4d057e
Previously, this was restricted to targets that enable R8 full mode, but
that was really just a temporary carveout to avoid disrupting other
targets. Since then, R8 full mode has been enabled by default for all
app targets, and the hash-based mapping mechanism is further integrated
into various debugging and retracing pipelines.
As of now, there are are only a very small number of targets that have
enabled optimization/obfuscation and are still using R8 compat mode, so
the build-time impact of this change should be minimal, and there should
be no functional runtime side effects.
Bug: 297566172
Test: m framework-appsearch + inspect proguard mapping
Change-Id: I5dfea60f60dc37b8445c8fddba6a4eab0dc41d96
When targetSdk is >= 30, the system verifies that you use a valid
signature V2+ certificate. Uncompressing ndk/dex files or aligning
the zip file will break a signature V2, so these apks should really
just set preprocessed: true.
Fixes: 185811447
Test: Presubmits
Change-Id: Id89c42bcd5b5daa6eda1716bff4023423298036b
This is attempt 4 at landing this change. Prior attempts were
reverted due to downstream test breakages not in presubmit.
Those issues have been resolved, and additional manual heavy
presubmit tests were run to ensure stability.
Observed APK savings: ~24MB
This reverts commit 74a5c2ec76.
Reason for revert: Fixed ManagedProvisioningTests
Bug: 215530220
Change-Id: I223228a345fa1a3bad52fb3e91c744107e04fc07
Targets with the special level 10000 are compiled using the current
platform SDK level. They are also compiled as a "platform build" which
will disable features such as API modeling and method backports.
Bug: 295591477
Test: manual inspection of the updated build commands
Change-Id: Ifda8859396b33dde4c46a9b212ddb855b012bf07
Add a property to export proguard flags files for libs dependencies.
Currently only proguard flags files from static deps are propagated up
to reverse dependencies, but it is necessary sometimes to have flags
from libs dependencies also be propagated.
Bug: 289087274
Test: go test ./java
Change-Id: Ic0aa22b086792bf322041aa5780db6c4f4eb2770
This is attempt 3 at landing this change. Prior attempts were
reverted due to downstream test breakages not in presubmit.
Those issues have been resolved, and additional manual heavy
presubmit tests were run to ensure stability.
Observed APK savings: ~24MB
This reverts commit a2ab93666d.
Reason for revert: Fixed SdkSandboxManagerTest by preserving
existing R8 compat mode for the aosp variant of SdkSandbox target.
Bug: 215530220
Bug: 293177283
Test: atest SdkSandboxManagerTests && \
atest SdkSandboxStorageHostTest && \
atest SdkSandboxLifecycleHostTest
Change-Id: If5636638875b6f67e0cc0ba4fd253a8d99d8db1d
This provides significant size savings over the default compatibility
mode, roughly ~20MB in aggregate for a recent Pixel build. Targets can opt out using `proguard_compatibility = true`.
Future work will enable for all targets, not just apps, but this
incremental change yields the most benefit.
Bug: 215530220
Test: m + presubmit
Change-Id: I52a9b27ebe71835849e200e23ae2a250eaf1bbe1