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

Commit aa003b38 authored by Kiyoung Kim's avatar Kiyoung Kim Committed by Gerrit Code Review
Browse files

Merge "Remove symlink to the build.ninja"

parents ee31de71 d9efcabf
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -531,8 +531,6 @@ func main() {

	var finalOutputFile string

	writeSymlink := false

	// Run Soong for a specific activity, like bp2build, queryview
	// or the actual Soong build for the build.ninja file.
	switch configuration.BuildMode {
@@ -555,13 +553,8 @@ func main() {
					maybeQuit(err, "")
				}
			}
			writeSymlink = true
		} else {
			finalOutputFile = runSoongOnlyBuild(ctx, extraNinjaDeps)

			if configuration.BuildMode == android.AnalysisNoBazel {
				writeSymlink = true
			}
		}
		writeMetrics(configuration, ctx.EventHandler, metricsDir)
	}
@@ -578,24 +571,6 @@ func main() {
	// are ninja inputs to the main output file, then ninja would superfluously
	// rebuild this output file on the next build invocation.
	touch(shared.JoinPath(topDir, finalOutputFile))

	// TODO(b/277029044): Remove this function once build.<product>.ninja lands
	if writeSymlink {
		writeBuildNinjaSymlink(configuration, finalOutputFile)
	}
}

// TODO(b/277029044): Remove this function once build.<product>.ninja lands
func writeBuildNinjaSymlink(config android.Config, source string) {
	targetPath := shared.JoinPath(topDir, config.SoongOutDir(), "build.ninja")
	sourcePath := shared.JoinPath(topDir, source)

	if targetPath == sourcePath {
		return
	}

	os.Remove(targetPath)
	os.Symlink(sourcePath, targetPath)
}

func writeUsedEnvironmentFile(configuration android.Config) {