Merge remote-tracking branch 'aosp/upstream' am: d877dde242 am: bc3c09c88d am: ae72f8c943 am: 69f1c17e4a

Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1349285

Change-Id: I6da02ab7475c0968ea8e1bc7c978b3135198130a
This commit is contained in:
Dan Willemsen 2020-06-25 01:41:53 +00:00 committed by Automerger Merge Worker
commit 18dd77d8a9

View file

@ -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 {