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

Commit 5c6b9484 authored by Usta Shrestha's avatar Usta Shrestha
Browse files

Use EventHandler.Do()

Bug: N/A
Test: manually verified (e.g. ran `m nothing` successfully)
Change-Id: Ie832019f8a81e127e64946070a712126997f7a35
parent 86db8821
Loading
Loading
Loading
Loading
+68 −68
Original line number Diff line number Diff line
@@ -475,7 +475,8 @@ func getExistingBazelRelatedFiles(topDir string) ([]string, error) {
// Bazel BUILD files instead of Ninja files.
func runBp2Build(configuration android.Config, extraNinjaDeps []string) {
	eventHandler := metrics.EventHandler{}
	eventHandler.Begin("bp2build")
	var metrics bp2build.CodegenMetrics
	eventHandler.Do("bp2build", func() {

		// Register an alternate set of singletons and mutators for bazel
		// conversion for Bazel conversion.
@@ -517,7 +518,7 @@ func runBp2Build(configuration android.Config, extraNinjaDeps []string) {
		// Run the code-generation phase to convert BazelTargetModules to BUILD files
		// and print conversion metrics to the user.
		codegenContext := bp2build.NewCodegenContext(configuration, *bp2buildCtx, bp2build.Bp2Build)
	metrics := bp2build.Codegen(codegenContext)
		metrics = bp2build.Codegen(codegenContext)

		generatedRoot := shared.JoinPath(configuration.SoongOutDir(), "bp2build")
		workspaceRoot := shared.JoinPath(configuration.SoongOutDir(), "workspace")
@@ -555,8 +556,7 @@ func runBp2Build(configuration android.Config, extraNinjaDeps []string) {

		// Create an empty bp2build marker file.
		touch(shared.JoinPath(topDir, bp2buildMarker))

	eventHandler.End("bp2build")
	})

	// Only report metrics when in bp2build mode. The metrics aren't relevant
	// for queryview, since that's a total repo-wide conversion and there's a