Add dependency checker special case for out/build_date.txt.
Test: Future TH presubmit.
Change-Id: I4f80cf12be4aa1a3040b38ac7c6bed593aefd65e
diff --git a/ui/build/test_build.go b/ui/build/test_build.go
index 3164680..41acc26 100644
--- a/ui/build/test_build.go
+++ b/ui/build/test_build.go
@@ -68,6 +68,7 @@
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 @@
// 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 @@
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