Group mixed mode and normal soong build
Mixed mode is a special form of the soong build. They both share common initialization and metrics so they should be grouped together to avoid duplicating that common behavior. Bug: 257650737 Test: m nothing Change-Id: I939b6264f94b69825735dce895132f33401238b6
This commit is contained in:
@@ -165,7 +165,7 @@ func newConfig(availableEnv map[string]string) android.Config {
|
||||
// Bazel-enabled mode. Attaches a mutator to queue Bazel requests, adds a
|
||||
// BeforePrepareBuildActionsHook to invoke Bazel, and then uses Bazel metadata
|
||||
// for modules that should be handled by Bazel.
|
||||
func runMixedModeBuild(configuration android.Config, ctx *android.Context, extraNinjaDeps []string) {
|
||||
func runMixedModeBuild(configuration android.Config, ctx *android.Context, extraNinjaDeps []string) string {
|
||||
ctx.EventHandler.Begin("mixed_build")
|
||||
defer ctx.EventHandler.End("mixed_build")
|
||||
|
||||
@@ -188,6 +188,7 @@ func runMixedModeBuild(configuration android.Config, ctx *android.Context, extra
|
||||
ninjaDeps = append(ninjaDeps, globListFiles...)
|
||||
|
||||
writeDepFile(cmdlineArgs.OutFile, ctx.EventHandler, ninjaDeps)
|
||||
return cmdlineArgs.OutFile
|
||||
}
|
||||
|
||||
// Run the code-generation phase to convert BazelTargetModules to BUILD files.
|
||||
@@ -356,11 +357,19 @@ func doChosenActivity(ctx *android.Context, configuration android.Config, extraN
|
||||
// Blueprint to BUILD files before everything else.
|
||||
runBp2Build(configuration, extraNinjaDeps, metricsDir)
|
||||
return bp2buildMarker
|
||||
} else if configuration.IsMixedBuildsEnabled() {
|
||||
runMixedModeBuild(configuration, ctx, extraNinjaDeps)
|
||||
} else if configuration.BuildMode == android.ApiBp2build {
|
||||
return runApiBp2build(configuration, extraNinjaDeps)
|
||||
} else {
|
||||
if configuration.IsMixedBuildsEnabled() {
|
||||
return runMixedModeBuild(configuration, ctx, extraNinjaDeps)
|
||||
} else {
|
||||
return runSoongOnlyBuild(configuration, ctx, extraNinjaDeps)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// runSoongOnlyBuild runs the standard Soong build in a number of different modes.
|
||||
func runSoongOnlyBuild(configuration android.Config, ctx *android.Context, extraNinjaDeps []string) string {
|
||||
var stopBefore bootstrap.StopBefore
|
||||
if configuration.BuildMode == android.GenerateModuleGraph {
|
||||
stopBefore = bootstrap.StopBeforeWriteNinja
|
||||
@@ -401,8 +410,6 @@ func doChosenActivity(ctx *android.Context, configuration android.Config, extraN
|
||||
// above
|
||||
writeDepFile(cmdlineArgs.OutFile, ctx.EventHandler, ninjaDeps)
|
||||
}
|
||||
}
|
||||
|
||||
return cmdlineArgs.OutFile
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user