Refactor Kati logic
Make the cleanspec & Android.mk runs of kati use much of the same code
and arguments.
Also renames 'Kati' to 'KatiBuild' in many cases, in the the expectation
that we'll have a 'KatiPackage' step in the future.
Use --no_ninja_prelude and move local_pool & _kati_always_build_ into
the combined ninja file. This will reduce the need to re-read makefiles
when Goma is enabled, and it allows us to include more than one
Kati-generated ninja file in the build graph.
Bug: 116968624
Test: build_test on downstream branches
Change-Id: Ibdac689b81f62dc293647fad917d84946f2c3cfa
diff --git a/cmd/multiproduct_kati/main.go b/cmd/multiproduct_kati/main.go
index 4933f37..9cb75fa 100644
--- a/cmd/multiproduct_kati/main.go
+++ b/cmd/multiproduct_kati/main.go
@@ -415,7 +415,7 @@
}
if *incremental {
// Save space, Kati doesn't notice
- if f := config.KatiNinjaFile(); f != "" {
+ if f := config.KatiBuildNinjaFile(); f != "" {
os.Truncate(f, 0)
}
} else {
@@ -436,7 +436,7 @@
// Save std_full.log if Kati re-read the makefiles
if buildWhat&build.BuildKati != 0 {
- if after, err := os.Stat(config.KatiNinjaFile()); err == nil && after.ModTime().After(before) {
+ if after, err := os.Stat(config.KatiBuildNinjaFile()); err == nil && after.ModTime().After(before) {
err := copyFile(stdLog, filepath.Join(filepath.Dir(stdLog), "std_full.log"))
if err != nil {
log.Fatalf("Error copying log file: %s", err)