diff options
author | Dan Willemsen <dwillemsen@google.com> | 2017-10-13 23:22:00 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-13 23:22:00 +0000 |
commit | 37cba1471f5275676c1e6d9a94f0b5597862b1db (patch) | |
tree | 393b1d014b06f30b0f4420ae122a7445119000ad /ui | |
parent | daf774f1f0b7633f78b834a5bb4938f93cba7756 (diff) | |
parent | b2e6c2e571058cfd9a3cf7a23927fb1c49d59523 (diff) | |
download | build_soong-37cba1471f5275676c1e6d9a94f0b5597862b1db.tar.gz build_soong-37cba1471f5275676c1e6d9a94f0b5597862b1db.tar.bz2 build_soong-37cba1471f5275676c1e6d9a94f0b5597862b1db.zip |
Merge "Switch product configs from make to ckati"
Diffstat (limited to 'ui')
-rw-r--r-- | ui/build/Android.bp | 2 | ||||
-rw-r--r-- | ui/build/build.go | 2 | ||||
-rw-r--r-- | ui/build/dumpvars.go (renamed from ui/build/make.go) | 37 | ||||
-rw-r--r-- | ui/build/kati.go | 2 | ||||
-rw-r--r-- | ui/build/sandbox_darwin.go | 2 | ||||
-rw-r--r-- | ui/build/sandbox_linux.go | 2 |
6 files changed, 23 insertions, 24 deletions
diff --git a/ui/build/Android.bp b/ui/build/Android.bp index 34c21f70..d1b49438 100644 --- a/ui/build/Android.bp +++ b/ui/build/Android.bp @@ -27,11 +27,11 @@ bootstrap_go_package { "cleanbuild.go", "config.go", "context.go", + "dumpvars.go", "environment.go", "exec.go", "finder.go", "kati.go", - "make.go", "ninja.go", "proc_sync.go", "signal.go", diff --git a/ui/build/build.go b/ui/build/build.go index 45d18e0a..0df22b34 100644 --- a/ui/build/build.go +++ b/ui/build/build.go @@ -104,7 +104,7 @@ func checkCaseSensitivity(ctx Context, config Config) { func help(ctx Context, config Config, what int) { cmd := Command(ctx, config, "help.sh", "build/make/help.sh") - cmd.Sandbox = makeSandbox + cmd.Sandbox = dumpvarsSandbox cmd.Stdout = ctx.Stdout() cmd.Stderr = ctx.Stderr() cmd.RunOrFatal() diff --git a/ui/build/make.go b/ui/build/dumpvars.go index edf6d96a..e6c3f56b 100644 --- a/ui/build/make.go +++ b/ui/build/dumpvars.go @@ -16,7 +16,6 @@ package build import ( "fmt" - "path/filepath" "strings" ) @@ -28,27 +27,29 @@ import ( // Make without actually building them. So all the variables based on // MAKECMDGOALS can be read. // -// extra_targets adds real arguments to the make command, in case other targets -// actually need to be run (like the Soong config generator). -// // vars is the list of variables to read. The values will be put in the // returned map. -func DumpMakeVars(ctx Context, config Config, goals, extra_targets, vars []string) (map[string]string, error) { +func DumpMakeVars(ctx Context, config Config, goals, vars []string) (map[string]string, error) { + return dumpMakeVars(ctx, config, goals, vars, false) +} + +func dumpMakeVars(ctx Context, config Config, goals, vars []string, write_soong_vars bool) (map[string]string, error) { ctx.BeginTrace("dumpvars") defer ctx.EndTrace() - cmd := Command(ctx, config, "make", - "make", - "--no-print-directory", - "-f", "build/core/config.mk", + cmd := Command(ctx, config, "dumpvars", + config.PrebuiltBuildTool("ckati"), + "-f", "build/make/core/config.mk", + "--color_warnings", "dump-many-vars", - "CALLED_FROM_SETUP=true", - "BUILD_SYSTEM=build/core", - "MAKECMDGOALS="+strings.Join(goals, " "), - "DUMP_MANY_VARS="+strings.Join(vars, " "), - "OUT_DIR="+config.OutDir()) - cmd.Args = append(cmd.Args, extra_targets...) - cmd.Sandbox = makeSandbox + "MAKECMDGOALS="+strings.Join(goals, " ")) + cmd.Environment.Set("CALLED_FROM_SETUP", "true") + cmd.Environment.Set("BUILD_SYSTEM", "build/make/core") + if write_soong_vars { + cmd.Environment.Set("WRITE_SOONG_VARIABLES", "true") + } + cmd.Environment.Set("DUMP_MANY_VARS", strings.Join(vars, " ")) + cmd.Sandbox = dumpvarsSandbox // TODO: error out when Stderr contains any content cmd.Stderr = ctx.Stderr() output, err := cmd.Output() @@ -136,9 +137,7 @@ func runMakeProductConfig(ctx Context, config Config) { "TARGET_DEVICE", }, exportEnvVars...), bannerVars...) - make_vars, err := DumpMakeVars(ctx, config, config.Arguments(), []string{ - filepath.Join(config.SoongOutDir(), "soong.variables"), - }, allVars) + make_vars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true) if err != nil { ctx.Fatalln("Error dumping make vars:", err) } diff --git a/ui/build/kati.go b/ui/build/kati.go index cc02c761..c58621e7 100644 --- a/ui/build/kati.go +++ b/ui/build/kati.go @@ -77,7 +77,7 @@ func runKati(ctx Context, config Config) { "--color_warnings", "--gen_all_targets", "--werror_find_emulator", - "-f", "build/core/main.mk", + "-f", "build/make/core/main.mk", } if !config.Environment().IsFalse("KATI_EMULATE_FIND") { diff --git a/ui/build/sandbox_darwin.go b/ui/build/sandbox_darwin.go index 60407d49..2cf6e20e 100644 --- a/ui/build/sandbox_darwin.go +++ b/ui/build/sandbox_darwin.go @@ -24,7 +24,7 @@ type Sandbox string const ( noSandbox = "" globalSandbox = "build/soong/ui/build/sandbox/darwin/global.sb" - makeSandbox = globalSandbox + dumpvarsSandbox = globalSandbox soongSandbox = globalSandbox katiSandbox = globalSandbox katiCleanSpecSandbox = globalSandbox diff --git a/ui/build/sandbox_linux.go b/ui/build/sandbox_linux.go index 6615d374..f2bfac29 100644 --- a/ui/build/sandbox_linux.go +++ b/ui/build/sandbox_linux.go @@ -19,7 +19,7 @@ type Sandbox bool const ( noSandbox = false globalSandbox = false - makeSandbox = false + dumpvarsSandbox = false soongSandbox = false katiSandbox = false katiCleanSpecSandbox = false |