Merge remote-tracking branch 'aosp/upstream' am: d877dde242
am: bc3c09c88d
am: ae72f8c943
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1349285 Change-Id: I86a6cc569f0566c95a92d5db0842edf17ffae28d
This commit is contained in:
commit
69f1c17e4a
1 changed files with 7 additions and 5 deletions
|
@ -21,7 +21,6 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
"github.com/google/blueprint/deptools"
|
||||
"github.com/google/blueprint/pathtools"
|
||||
)
|
||||
|
||||
|
@ -130,15 +129,18 @@ func (s *globSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
|||
if s.writeRule {
|
||||
depFile := fileListFile + ".d"
|
||||
|
||||
// We need to write the file list here so that it has an older modified date
|
||||
// than the build.ninja (otherwise we'd run the primary builder twice on
|
||||
// every new glob)
|
||||
//
|
||||
// We don't need to write the depfile because we're guaranteed that ninja
|
||||
// will run the command at least once (to record it into the ninja_log), so
|
||||
// the depfile will be loaded from that execution.
|
||||
fileList := strings.Join(g.Files, "\n") + "\n"
|
||||
err := pathtools.WriteFileIfChanged(absolutePath(fileListFile), []byte(fileList), 0666)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("error writing %s: %s", fileListFile, err))
|
||||
}
|
||||
err = deptools.WriteDepFile(absolutePath(depFile), fileListFile, g.Deps)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("error writing %s: %s", depFile, err))
|
||||
}
|
||||
|
||||
GlobFile(ctx, g.Pattern, g.Excludes, fileListFile, depFile)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue