Merge "Remove kati marker in soong-only build" am: e6266e04f5 am: 5152ed29f1

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1741174

Change-Id: Id49ae89d1106c36240508af19aac0656634ff105
This commit is contained in:
Anton Hansson
2021-06-30 10:03:50 +00:00
committed by Automerger Merge Worker

View File

@@ -28,16 +28,20 @@ import (
func SetupOutDir(ctx Context, config Config) {
ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "Android.mk"))
ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "CleanSpec.mk"))
if !config.SkipKati() {
// Run soong_build with Kati for a hybrid build, e.g. running the
// AndroidMk singleton and postinstall commands. Communicate this to
// soong_build by writing an empty .soong.kati_enabled marker file in the
// soong_build output directory for the soong_build primary builder to
// know if the user wants to run Kati after.
//
// This does not preclude running Kati for *product configuration purposes*.
ensureEmptyFileExists(ctx, filepath.Join(config.SoongOutDir(), ".soong.kati_enabled"))
// Potentially write a marker file for whether kati is enabled. This is used by soong_build to
// potentially run the AndroidMk singleton and postinstall commands.
// Note that the absence of the file does not not preclude running Kati for product
// configuration purposes.
katiEnabledMarker := filepath.Join(config.SoongOutDir(), ".soong.kati_enabled")
if config.SkipKatiNinja() {
os.Remove(katiEnabledMarker)
// Note that we can not remove the file for SkipKati builds yet -- some continuous builds
// --skip-make builds rely on kati targets being defined.
} else if !config.SkipKati() {
ensureEmptyFileExists(ctx, katiEnabledMarker)
}
// The ninja_build file is used by our buildbots to understand that the output
// can be parsed as ninja output.
ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "ninja_build"))