Merge "Fix out/soong/Android-<>.mk reproducibility" am: 2e93eb702d

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1353442

Change-Id: I529e89400a980a585ba295c5e4a5fa985a1120be
This commit is contained in:
Treehugger Robot
2020-07-02 01:13:38 +00:00
committed by Automerger Merge Worker

View File

@@ -28,6 +28,7 @@ package android
// module based on it. // module based on it.
import ( import (
"sort"
"sync" "sync"
"github.com/google/blueprint" "github.com/google/blueprint"
@@ -161,6 +162,11 @@ func (b *OverridableModuleBase) addOverride(o OverrideModule) {
// Should NOT be used in the same mutator as addOverride. // Should NOT be used in the same mutator as addOverride.
func (b *OverridableModuleBase) getOverrides() []OverrideModule { func (b *OverridableModuleBase) getOverrides() []OverrideModule {
b.overridesLock.Lock()
sort.Slice(b.overrides, func(i, j int) bool {
return b.overrides[i].Name() < b.overrides[j].Name()
})
b.overridesLock.Unlock()
return b.overrides return b.overrides
} }