diff options
Diffstat (limited to 'android/makevars.go')
-rw-r--r-- | android/makevars.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/android/makevars.go b/android/makevars.go index 8305d8e00..d4389cfac 100644 --- a/android/makevars.go +++ b/android/makevars.go @@ -220,7 +220,7 @@ type phony struct { type dist struct { goals []string - paths []string + paths distCopies } func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) { @@ -330,7 +330,7 @@ func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) { 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, dists[j].paths) + return lessArr(dists[i].goals, dists[j].goals) || lessArr(dists[i].paths.Strings(), dists[j].paths.Strings()) }) outBytes := s.writeVars(vars) @@ -458,7 +458,7 @@ func (s *makeVarsSingleton) writeLate(phonies []phony, dists []dist) []byte { for _, dist := range dists { fmt.Fprintf(buf, ".PHONY: %s\n", strings.Join(dist.goals, " ")) fmt.Fprintf(buf, "$(call dist-for-goals,%s,%s)\n", - strings.Join(dist.goals, " "), strings.Join(dist.paths, " ")) + strings.Join(dist.goals, " "), strings.Join(dist.paths.Strings(), " ")) } return buf.Bytes() @@ -607,7 +607,7 @@ func (c *makeVarsContext) addPhony(name string, deps []string) { c.phonies = append(c.phonies, phony{name, deps}) } -func (c *makeVarsContext) addDist(goals []string, paths []string) { +func (c *makeVarsContext) addDist(goals []string, paths []distCopy) { c.dists = append(c.dists, dist{ goals: goals, paths: paths, @@ -647,9 +647,15 @@ func (c *makeVarsContext) DistForGoalWithFilename(goal string, path Path, filena } func (c *makeVarsContext) DistForGoals(goals []string, paths ...Path) { - c.addDist(goals, Paths(paths).Strings()) + var copies distCopies + for _, path := range paths { + copies = append(copies, distCopy{ + from: path, + }) + } + c.addDist(goals, copies) } func (c *makeVarsContext) DistForGoalsWithFilename(goals []string, path Path, filename string) { - c.addDist(goals, []string{path.String() + ":" + filename}) + c.addDist(goals, distCopies{{from: path, dest: filename}}) } |