Merge "Revert "Avoid duplicated classes for boot dex jars"" am: ead014b8f9
am: 02e12e491c
Change-Id: If3211cfd070fc3fb503b45b0e6053cf792c72848
This commit is contained in:
@@ -16,7 +16,6 @@ package java
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
)
|
)
|
||||||
@@ -153,23 +152,11 @@ func stubFlagsRule(ctx android.SingletonContext) {
|
|||||||
// Collect dex jar paths for modules that had hiddenapi encode called on them.
|
// Collect dex jar paths for modules that had hiddenapi encode called on them.
|
||||||
if h, ok := module.(hiddenAPIIntf); ok {
|
if h, ok := module.(hiddenAPIIntf); ok {
|
||||||
if jar := h.bootDexJar(); jar != nil {
|
if jar := h.bootDexJar(); jar != nil {
|
||||||
// Don't add multiple variants of the same library to bootDexJars, otherwise
|
// For a java lib included in an APEX, only take the one built for
|
||||||
// hiddenapi tool will complain about duplicated classes. Such multiple variants
|
// the platform variant, and skip the variants for APEXes.
|
||||||
// of the same library can happen when the library is included in one or more APEXes.
|
// Otherwise, the hiddenapi tool will complain about duplicated classes
|
||||||
// TODO(b/146308764): remove this heuristic
|
if a, ok := module.(android.ApexModule); ok {
|
||||||
if a, ok := module.(android.ApexModule); ok && android.InAnyApex(module.Name()) {
|
if android.InAnyApex(module.Name()) && !a.IsForPlatform() {
|
||||||
if a.AvailableFor("//apex_available:platform") && !a.IsForPlatform() {
|
|
||||||
// skip the apex variants if the jar is available for the platform
|
|
||||||
return
|
|
||||||
}
|
|
||||||
apexName := a.ApexName()
|
|
||||||
if strings.Contains(apexName, "test") {
|
|
||||||
// skip the if the jar is in test APEX
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if strings.Contains(apexName, "com.android.art") && apexName != "com.android.art.release" {
|
|
||||||
// skip the ART APEX variants other than com.android.art.release
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user