Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb0454b2 authored by Lukacs T. Berki's avatar Lukacs T. Berki
Browse files

Generate actions when building the module graph.

This is necessary because GenerateAndroidBuildActions() is effectively a
mutator and therefore can change the data stored in each module.
Sometimes one wants to dump that data in the JSON module graph, and in
order to do so, actions need to be generated.

I briefly entertained removing StopBeforePrepareBuildActions(), but it
incurs a 10-second penalty on "m soong_docs" and "m bp2build" so I
decided to keep it.

Test: Presubmits.
Change-Id: I438aaf981e989dc39a09e8a2ba73f7a08ee55386
parent cbab07b4
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -217,15 +217,6 @@ func doChosenActivity(configuration android.Config, extraNinjaDeps []string) str
	generateModuleGraphFile := moduleGraphFile != ""
	generateDocFile := docFile != ""

	blueprintArgs := cmdlineArgs

	var stopBefore bootstrap.StopBefore
	if !generateModuleGraphFile && !generateQueryView && !generateDocFile {
		stopBefore = bootstrap.DoEverything
	} else {
		stopBefore = bootstrap.StopBeforePrepareBuildActions
	}

	if generateBazelWorkspace {
		// Run the alternate pipeline of bp2build mutators and singleton to convert
		// Blueprint to BUILD files before everything else.
@@ -233,6 +224,19 @@ func doChosenActivity(configuration android.Config, extraNinjaDeps []string) str
		return bp2buildMarker
	}

	blueprintArgs := cmdlineArgs

	var stopBefore bootstrap.StopBefore
	if generateModuleGraphFile {
		stopBefore = bootstrap.StopBeforeWriteNinja
	} else if generateQueryView {
		stopBefore = bootstrap.StopBeforePrepareBuildActions
	} else if generateDocFile {
		stopBefore = bootstrap.StopBeforePrepareBuildActions
	} else {
		stopBefore = bootstrap.DoEverything
	}

	ctx := newContext(configuration)
	if mixedModeBuild {
		runMixedModeBuild(configuration, ctx, extraNinjaDeps)