Skip to content

Instantly share code, notes, and snippets.

@goyaljai
Last active January 31, 2023 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyaljai/3c6e9a462bf36fc4e5560d1a1ae812b0 to your computer and use it in GitHub Desktop.
Save goyaljai/3c6e9a462bf36fc4e5560d1a1ae812b0 to your computer and use it in GitHub Desktop.
build.go
func Build(ctx Context, config Config) {
...
what := RunAll
...
if config.SkipKati() {
ctx.Verboseln("Skipping Kati as requested")
what = what &^ RunKati
}
if config.SkipKatiNinja() {
ctx.Verboseln("Skipping use of Kati ninja as requested")
what = what &^ RunKatiNinja
}
if config.SkipSoong() {
ctx.Verboseln("Skipping use of Soong as requested")
what = what &^ RunSoong
}
if config.SkipNinja() {
ctx.Verboseln("Skipping Ninja as requested")
what = what &^ RunNinja
}
...
if what&RunSoong != 0 {
runSoong(ctx, config)
}
if what&RunKati != 0 {
genKatiSuffix(ctx, config)
runKatiCleanSpec(ctx, config)
runKatiBuild(ctx, config)
runKatiPackage(ctx, config)
ioutil.WriteFile(config.LastKatiSuffixFile(), []byte(config.KatiSuffix()), 0666) // a+rw
}
...
if what&RunNinja != 0 {
if what&RunKati != 0 {
installCleanIfNecessary(ctx, config)
}
runNinjaForBuild(ctx, config)
}
// Currently, using Bazel requires Kati and Soong to run first, so check whether to run Bazel last.
if what&RunBazel != 0 {
runBazel(ctx, config)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment