Split Java libraries per apex
Just like native libs, a java library that is included in an APEX is mutated for the APEX. This allows us to infer the context (e.g. sdk_version, etc.) for building a java library in an APEX. Bug: 138182343 Test: apex_test added Change-Id: I9292ea097b98e74a8a794f164bd2bed3921d6337
This commit is contained in:
@@ -152,6 +152,14 @@ func stubFlagsRule(ctx android.SingletonContext) {
|
||||
// Collect dex jar paths for modules that had hiddenapi encode called on them.
|
||||
if h, ok := module.(hiddenAPIIntf); ok {
|
||||
if jar := h.bootDexJar(); jar != nil {
|
||||
// For a java lib included in an APEX, only take the one built for
|
||||
// the platform variant, and skip the variants for APEXes.
|
||||
// Otherwise, the hiddenapi tool will complain about duplicated classes
|
||||
if a, ok := module.(android.ApexModule); ok {
|
||||
if android.InAnyApex(module.Name()) && !a.IsForPlatform() {
|
||||
return
|
||||
}
|
||||
}
|
||||
bootDexJars = append(bootDexJars, jar)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user