platform_build_soong/sdk
Colin Cross d6b2525b00 Deduplicate APEX variants that would build identically
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories.  This causes unnecessary
build time and disk space for duplicated work.

Deduplicate APEX variants that would build identically.  Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.

This has one significant change in behavior.  Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs.  After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.

In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs.  However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.

This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I0529837476a253c32b3dfb98dcccf107427c742c
2020-08-17 15:18:31 -07:00
..
Android.bp Soong package structure refactoring 2020-06-01 13:44:48 -07:00
bp.go Fix bug in error reporting when adding duplicate properties 2020-03-02 16:29:11 +00:00
bp_test.go Defer \n quoting generatedContents until creating the ninja rule 2020-05-11 22:59:25 +01:00
cc_sdk_test.go Deduplicate APEX variants that would build identically 2020-08-17 15:18:31 -07:00
exports.go Restrict SdkMemberTypes that can be used with sdk/sdk_snapshot 2019-12-31 15:08:59 +00:00
exports_test.go Add CommonOS variant for sdk 2020-03-02 19:31:26 +00:00
java_sdk_test.go Deduplicate APEX variants that would build identically 2020-08-17 15:18:31 -07:00
sdk.go Avoid creating APEX variant for sdk member 2020-07-24 11:10:10 +01:00
sdk_test.go Disable all SDK snapshot generation tests on mac. 2020-07-15 16:58:05 +01:00
testing.go Fix prebuilt mutator ordering in tests 2020-07-31 16:12:01 +01:00
update.go Disable all host OS variants except those explicitly included. 2020-08-03 21:06:50 +01:00