Create APEX variation only when needed
Create an APEX variation of a module only when it is either directly included in an APEX or the dependency to the module demands that the module should be included. For example, a non-static dependency to a java library no longer creates an APEX variant of the library. Bug: 146907857 Test: m (apex_test amended) Test: cat out/soong/build.ninja | grep "Module:" | wc -l reduced from 47132 to 45881 Change-Id: Icd79fb4b60668d852b9f018343b934b5e42a8eda
This commit is contained in:
@@ -105,7 +105,8 @@ func apexDepsMutator(mctx android.BottomUpMutatorContext) {
|
||||
android.UpdateApexDependency(apexBundleName, depName, directDep)
|
||||
}
|
||||
|
||||
if am, ok := child.(android.ApexModule); ok && am.CanHaveApexVariants() {
|
||||
if am, ok := child.(android.ApexModule); ok && am.CanHaveApexVariants() &&
|
||||
(directDep || am.DepIsInSameApex(mctx, child)) {
|
||||
am.BuildForApex(apexBundleName)
|
||||
return true
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user