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

Commit 0bc9a9ad authored by Rupert Shuttleworth's avatar Rupert Shuttleworth
Browse files

Add dependency checker special case for out/build_date.txt.

Test: Future TH presubmit.
Change-Id: I4f80cf12be4aa1a3040b38ac7c6bed593aefd65e
parent 78b340f3
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ func testForDanglingRules(ctx Context, config Config) {
	miniBootstrapDir := filepath.Join(outDir, "soong", ".minibootstrap")
	modulePathsDir := filepath.Join(outDir, ".module_paths")
	variablesFilePath := filepath.Join(outDir, "soong", "soong.variables")

	// dexpreopt.config is an input to the soong_docs action, which runs the
	// soong_build primary builder. However, this file is created from $(shell)
	// invocation at Kati parse time, so it's not an explicit output of any
@@ -75,6 +76,9 @@ func testForDanglingRules(ctx Context, config Config) {
	// treated as an source file.
	dexpreoptConfigFilePath := filepath.Join(outDir, "soong", "dexpreopt.config")

	// out/build_date.txt is considered a "source file"
	buildDatetimeFilePath := filepath.Join(outDir, "build_date.txt")

	danglingRules := make(map[string]bool)

	scanner := bufio.NewScanner(stdout)
@@ -88,7 +92,8 @@ func testForDanglingRules(ctx Context, config Config) {
			strings.HasPrefix(line, miniBootstrapDir) ||
			strings.HasPrefix(line, modulePathsDir) ||
			line == variablesFilePath ||
			line == dexpreoptConfigFilePath {
			line == dexpreoptConfigFilePath ||
			line == buildDatetimeFilePath {
			// Leaf node is in one of Soong's bootstrap directories, which do not have
			// full build rules in the primary build.ninja file.
			continue