Export depsInfo into android package.
Move depsInfo into android for easier sharing with APK code. Bug: 149622332 Test: m, diff'ing outputs for conscrypt module. Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
This commit is contained in:
38
apex/apex.go
38
apex/apex.go
@@ -1276,12 +1276,6 @@ func (af *apexFile) AvailableToPlatform() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
type depInfo struct {
|
||||
to string
|
||||
from []string
|
||||
isExternal bool
|
||||
}
|
||||
|
||||
type apexBundle struct {
|
||||
android.ModuleBase
|
||||
android.DefaultableModuleBase
|
||||
@@ -1316,7 +1310,7 @@ type apexBundle struct {
|
||||
requiredDeps []string
|
||||
|
||||
// list of module names that this APEX is including (to be shown via *-deps-info target)
|
||||
depInfos map[string]depInfo
|
||||
android.ApexBundleDepsInfo
|
||||
|
||||
testApex bool
|
||||
vndkApex bool
|
||||
@@ -1890,35 +1884,6 @@ func (a *apexBundle) checkUpdatable(ctx android.ModuleContext) {
|
||||
}
|
||||
}
|
||||
|
||||
// Collects the list of module names that directly or indirectly contributes to the payload of this APEX
|
||||
func (a *apexBundle) collectDepsInfo(ctx android.ModuleContext) {
|
||||
a.depInfos = make(map[string]depInfo)
|
||||
a.walkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
|
||||
if from.Name() == to.Name() {
|
||||
// This can happen for cc.reuseObjTag. We are not interested in tracking this.
|
||||
// As soon as the dependency graph crosses the APEX boundary, don't go further.
|
||||
return !externalDep
|
||||
}
|
||||
|
||||
if info, exists := a.depInfos[to.Name()]; exists {
|
||||
if !android.InList(from.Name(), info.from) {
|
||||
info.from = append(info.from, from.Name())
|
||||
}
|
||||
info.isExternal = info.isExternal && externalDep
|
||||
a.depInfos[to.Name()] = info
|
||||
} else {
|
||||
a.depInfos[to.Name()] = depInfo{
|
||||
to: to.Name(),
|
||||
from: []string{from.Name()},
|
||||
isExternal: externalDep,
|
||||
}
|
||||
}
|
||||
|
||||
// As soon as the dependency graph crosses the APEX boundary, don't go further.
|
||||
return !externalDep
|
||||
})
|
||||
}
|
||||
|
||||
func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
buildFlattenedAsDefault := ctx.Config().FlattenApex() && !ctx.Config().UnbundledBuild()
|
||||
switch a.properties.ApexType {
|
||||
@@ -1956,7 +1921,6 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
||||
a.checkApexAvailability(ctx)
|
||||
a.checkUpdatable(ctx)
|
||||
a.collectDepsInfo(ctx)
|
||||
|
||||
handleSpecialLibs := !android.Bool(a.properties.Ignore_system_library_special_case)
|
||||
|
||||
|
Reference in New Issue
Block a user