Export ModuleListFile in bootstrap (with fix) (#304)

* Export ModuleListFile in bootstrap (with fix)

* Run gofmt on command.go
This commit is contained in:
c-parsons 2020-06-15 12:03:27 -04:00 committed by GitHub
parent 743261c07e
commit fe2fa04c30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,13 +41,11 @@ var (
traceFile string traceFile string
runGoTests bool runGoTests bool
noGC bool noGC bool
moduleListFile string
emptyNinjaFile bool emptyNinjaFile bool
BuildDir string BuildDir string
ModuleListFile string
NinjaBuildDir string NinjaBuildDir string
SrcDir string SrcDir string
absSrcDir string absSrcDir string
) )
@ -63,7 +61,7 @@ func init() {
flag.StringVar(&memprofile, "memprofile", "", "write memory profile to file") flag.StringVar(&memprofile, "memprofile", "", "write memory profile to file")
flag.BoolVar(&noGC, "nogc", false, "turn off GC for debugging") flag.BoolVar(&noGC, "nogc", false, "turn off GC for debugging")
flag.BoolVar(&runGoTests, "t", false, "build and run go tests during bootstrap") flag.BoolVar(&runGoTests, "t", false, "build and run go tests during bootstrap")
flag.StringVar(&moduleListFile, "l", "", "file that lists filepaths to parse") flag.StringVar(&ModuleListFile, "l", "", "file that lists filepaths to parse")
flag.BoolVar(&emptyNinjaFile, "empty-ninja-file", false, "write out a 0-byte ninja file") flag.BoolVar(&emptyNinjaFile, "empty-ninja-file", false, "write out a 0-byte ninja file")
} }
@ -105,9 +103,9 @@ func Main(ctx *blueprint.Context, config interface{}, extraNinjaFileDeps ...stri
} }
SrcDir = filepath.Dir(flag.Arg(0)) SrcDir = filepath.Dir(flag.Arg(0))
if moduleListFile != "" { if ModuleListFile != "" {
ctx.SetModuleListFile(moduleListFile) ctx.SetModuleListFile(ModuleListFile)
extraNinjaFileDeps = append(extraNinjaFileDeps, moduleListFile) extraNinjaFileDeps = append(extraNinjaFileDeps, ModuleListFile)
} else { } else {
fatalf("-l <moduleListFile> is required and must be nonempty") fatalf("-l <moduleListFile> is required and must be nonempty")
} }
@ -133,7 +131,7 @@ func Main(ctx *blueprint.Context, config interface{}, extraNinjaFileDeps ...stri
topLevelBlueprintsFile: flag.Arg(0), topLevelBlueprintsFile: flag.Arg(0),
emptyNinjaFile: emptyNinjaFile, emptyNinjaFile: emptyNinjaFile,
runGoTests: runGoTests, runGoTests: runGoTests,
moduleListFile: moduleListFile, moduleListFile: ModuleListFile,
} }
ctx.RegisterBottomUpMutator("bootstrap_plugin_deps", pluginDeps) ctx.RegisterBottomUpMutator("bootstrap_plugin_deps", pluginDeps)