Propagate <uses-library> dependencies from android_library
to apps.
Automatically add `uses_libs`/`optional_uses_libs` properties specified in `android_library` modules to the apps that transitively depend on these libraries. Note that a library may choose to specify its <uses-library> deps as either optional or required. If this is not the right choice for an app, it should be able to override it by specifying its own `uses_libs`/ `optional_uses_libs` properties. Bug: 196377222 Test: lunch aosp_cf_x86_64_phone-userdebug && m Change-Id: I1e36c56719c0023dcd25fa6aeb92016471702b9f
This commit is contained in:
@@ -502,11 +502,12 @@ func (a *AndroidLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {
|
|||||||
if sdkDep.hasFrameworkLibs() {
|
if sdkDep.hasFrameworkLibs() {
|
||||||
a.aapt.deps(ctx, sdkDep)
|
a.aapt.deps(ctx, sdkDep)
|
||||||
}
|
}
|
||||||
|
a.usesLibrary.deps(ctx, sdkDep.hasFrameworkLibs())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AndroidLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (a *AndroidLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
a.aapt.isLibrary = true
|
a.aapt.isLibrary = true
|
||||||
a.classLoaderContexts = make(dexpreopt.ClassLoaderContextMap)
|
a.classLoaderContexts = a.usesLibrary.classLoaderContextForUsesLibDeps(ctx)
|
||||||
a.aapt.buildActions(ctx, android.SdkContext(a), a.classLoaderContexts)
|
a.aapt.buildActions(ctx, android.SdkContext(a), a.classLoaderContexts)
|
||||||
|
|
||||||
a.hideApexVariantFromMake = !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform()
|
a.hideApexVariantFromMake = !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform()
|
||||||
|
Reference in New Issue
Block a user