cosmetic: readability am: 4cff07db25 am: 35136c7d74 am: f1f0a2b86d am: d56dd996a3 am: b5998aaf98

Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2449269

Change-Id: I41837bd4087483f689545d080a40cd5ad171541d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Usta Shrestha 2023-03-02 07:29:19 +00:00 committed by Automerger Merge Worker
commit 48682b7724

View file

@ -3757,32 +3757,30 @@ func (c *Context) AllTargets() (map[string]string, error) {
}
targets := map[string]string{}
// Collect all the module build targets.
for _, module := range c.moduleInfo {
for _, buildDef := range module.actionDefs.buildDefs {
var collectTargets = func(actionDefs localBuildActions) error {
for _, buildDef := range actionDefs.buildDefs {
ruleName := buildDef.Rule.fullName(c.pkgNames)
for _, output := range append(buildDef.Outputs, buildDef.ImplicitOutputs...) {
outputValue, err := output.Eval(c.globalVariables)
if err != nil {
return nil, err
return err
}
targets[outputValue] = ruleName
}
}
return nil
}
// Collect all the module build targets.
for _, module := range c.moduleInfo {
if err := collectTargets(module.actionDefs); err != nil {
return nil, err
}
}
// Collect all the singleton build targets.
for _, info := range c.singletonInfo {
for _, buildDef := range info.actionDefs.buildDefs {
ruleName := buildDef.Rule.fullName(c.pkgNames)
for _, output := range append(buildDef.Outputs, buildDef.ImplicitOutputs...) {
outputValue, err := output.Eval(c.globalVariables)
if err != nil {
return nil, err
}
targets[outputValue] = ruleName
}
if err := collectTargets(info.actionDefs); err != nil {
return nil, err
}
}