diff options
Diffstat (limited to 'android/makevars.go')
-rw-r--r-- | android/makevars.go | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/android/makevars.go b/android/makevars.go index d4389cfac..baa1d4453 100644 --- a/android/makevars.go +++ b/android/makevars.go @@ -185,6 +185,7 @@ func makeVarsSingletonFunc() Singleton { type makeVarsSingleton struct { varsForTesting []makeVarsVariable installsForTesting []byte + lateForTesting []byte } type makeVarsProvider struct { @@ -265,6 +266,11 @@ func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) { dists = append(dists, mctx.dists...) } + singletonDists := getSingletonDists(ctx.Config()) + singletonDists.lock.Lock() + dists = append(dists, singletonDists.dists...) + singletonDists.lock.Unlock() + ctx.VisitAllModules(func(m Module) { if provider, ok := m.(ModuleMakeVarsProvider); ok && m.Enabled(ctx) { mctx := &makeVarsContext{ @@ -285,6 +291,10 @@ func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) { katiVintfManifestInstalls = append(katiVintfManifestInstalls, info.KatiVintfInstalls...) katiSymlinks = append(katiSymlinks, info.KatiSymlinks...) } + + if distInfo, ok := OtherModuleProvider(ctx, m, DistProvider); ok { + dists = append(dists, distInfo.Dists...) + } }) compareKatiInstalls := func(a, b katiInstall) int { @@ -318,19 +328,12 @@ func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) { sort.Slice(phonies, func(i, j int) bool { return phonies[i].name < phonies[j].name }) - lessArr := func(a, b []string) bool { - if len(a) == len(b) { - for i := range a { - if a[i] < b[i] { - return true - } - } - return false - } - return len(a) < len(b) - } sort.Slice(dists, func(i, j int) bool { - return lessArr(dists[i].goals, dists[j].goals) || lessArr(dists[i].paths.Strings(), dists[j].paths.Strings()) + goals := slices.Compare(dists[i].goals, dists[j].goals) + if goals != 0 { + return goals < 0 + } + return slices.Compare(dists[i].paths.Strings(), dists[j].paths.Strings()) < 0 }) outBytes := s.writeVars(vars) @@ -354,6 +357,7 @@ func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) { if ctx.Config().RunningInsideUnitTest() { s.varsForTesting = vars s.installsForTesting = installsBytes + s.lateForTesting = lateOutBytes } } @@ -651,6 +655,7 @@ func (c *makeVarsContext) DistForGoals(goals []string, paths ...Path) { for _, path := range paths { copies = append(copies, distCopy{ from: path, + dest: path.Base(), }) } c.addDist(goals, copies) |