Keep dependencies in order
Don't sort the dependencies, keep them in the order they were in the Blueprints file and use a set to prevent adding duplicates to the list. Change-Id: Icade91d035ccfb12c26ba0584144c1723607019c
This commit is contained in:
parent
3793062859
commit
a434b3fd69
1 changed files with 9 additions and 10 deletions
|
@ -846,9 +846,13 @@ func (c *Context) moduleDepNames(group *moduleGroup,
|
|||
config interface{}) ([]string, []error) {
|
||||
|
||||
depNamesSet := make(map[string]bool)
|
||||
depNames := []string{}
|
||||
|
||||
for _, depName := range group.properties.Deps {
|
||||
depNamesSet[depName] = true
|
||||
if !depNamesSet[depName] {
|
||||
depNamesSet[depName] = true
|
||||
depNames = append(depNames, depName)
|
||||
}
|
||||
}
|
||||
|
||||
if len(group.modules) != 1 {
|
||||
|
@ -870,18 +874,13 @@ func (c *Context) moduleDepNames(group *moduleGroup,
|
|||
}
|
||||
|
||||
for _, depName := range dynamicDeps {
|
||||
depNamesSet[depName] = true
|
||||
if !depNamesSet[depName] {
|
||||
depNamesSet[depName] = true
|
||||
depNames = append(depNames, depName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We need to sort the dependency names to ensure deterministic Ninja file
|
||||
// output from one run to the next.
|
||||
depNames := make([]string, 0, len(depNamesSet))
|
||||
for depName := range depNamesSet {
|
||||
depNames = append(depNames, depName)
|
||||
}
|
||||
sort.Strings(depNames)
|
||||
|
||||
return depNames, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue