Merge pull request #306 from danw/globs
Stop writing depfiles from Glob singleton
This commit is contained in:
commit
fe13954f3c
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