summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lukács T. Berki <lberki@google.com> 2021-03-18 08:58:16 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-03-18 08:58:16 +0000
commit734b215d66aab582c20bbcf425e058adfa2b87b0 (patch)
tree053a36f6926a6a8b8f376bdd1256c3f8dd17ef3c
parent7f09fd298a1d24c3d438e27dc590ea215114d8cd (diff)
parent5f6cb1d6d3465e7ef2d44482ecf2ac7a5d30b129 (diff)
Merge "Compile soong_build for debugging if needed."
-rw-r--r--android/config.go4
-rw-r--r--ui/build/soong.go18
2 files changed, 16 insertions, 6 deletions
diff --git a/android/config.go b/android/config.go
index c880aebc2..b6c862ddc 100644
--- a/android/config.go
+++ b/android/config.go
@@ -73,6 +73,10 @@ func (c Config) NinjaBuildDir() string {
return c.buildDir
}
+func (c Config) DebugCompilation() bool {
+ return false // Never compile Go code in the main build for debugging
+}
+
func (c Config) SrcDir() string {
return c.srcDir
}
diff --git a/ui/build/soong.go b/ui/build/soong.go
index fee5723bb..9afcb88ca 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -65,9 +65,10 @@ func writeEnvironmentFile(ctx Context, envFile string, envDeps map[string]string
// A tiny struct used to tell Blueprint that it's in bootstrap mode. It would
// probably be nicer to use a flag in bootstrap.Args instead.
type BlueprintConfig struct {
- srcDir string
- buildDir string
- ninjaBuildDir string
+ srcDir string
+ buildDir string
+ ninjaBuildDir string
+ debugCompilation bool
}
func (c BlueprintConfig) SrcDir() string {
@@ -82,6 +83,10 @@ func (c BlueprintConfig) NinjaBuildDir() string {
return c.ninjaBuildDir
}
+func (c BlueprintConfig) DebugCompilation() bool {
+ return c.debugCompilation
+}
+
func bootstrapBlueprint(ctx Context, config Config) {
ctx.BeginTrace(metrics.RunSoong, "blueprint bootstrap")
defer ctx.EndTrace()
@@ -102,9 +107,10 @@ func bootstrapBlueprint(ctx Context, config Config) {
blueprintCtx := blueprint.NewContext()
blueprintCtx.SetIgnoreUnknownModuleTypes(true)
blueprintConfig := BlueprintConfig{
- srcDir: os.Getenv("TOP"),
- buildDir: config.SoongOutDir(),
- ninjaBuildDir: config.OutDir(),
+ srcDir: os.Getenv("TOP"),
+ buildDir: config.SoongOutDir(),
+ ninjaBuildDir: config.OutDir(),
+ debugCompilation: os.Getenv("SOONG_DELVE") != "",
}
bootstrap.RunBlueprint(args, blueprintCtx, blueprintConfig)