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
This commit is contained in:
Dan Willemsen
2018-09-26 14:58:30 -07:00
parent 05518bc13b
commit 2997123f73
4 changed files with 49 additions and 70 deletions

View File

@@ -415,7 +415,7 @@ func buildProduct(mpctx *mpContext, product string) {
}
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 @@ func buildProduct(mpctx *mpContext, product string) {
// 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)