Merge "Fix reanalysis after full build" into main am: 05d9069051
am: 49361b616a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3266058 Change-Id: I003b0a0d9ef9a86eafa17d641ef9f23fb0b359fe Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -96,17 +96,31 @@ func (g *GoBinary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
outputFile := android.PathForArbitraryOutput(ctx, android.Rel(ctx, ctx.Config().OutDir(), g.IntermediateFile())).WithoutRel()
|
||||
g.outputFile = outputFile
|
||||
|
||||
// Don't create install rules for modules used by bootstrap, the install command line will differ from
|
||||
// what was used during bootstrap, which will cause ninja to rebuild the module on the next run,
|
||||
// triggering reanalysis.
|
||||
if !usedByBootstrap(ctx.ModuleName()) {
|
||||
installPath := ctx.InstallFile(android.PathForModuleInstall(ctx, "bin"), ctx.ModuleName(), outputFile)
|
||||
|
||||
if !ctx.Config().KatiEnabled() || g.ExportedToMake() {
|
||||
// Modules in an unexported namespace have no install rule, only add modules in the exported namespaces
|
||||
// to the blueprint_tools phony rules.
|
||||
if !ctx.Config().KatiEnabled() || g.ExportedToMake() {
|
||||
ctx.Phony("blueprint_tools", installPath)
|
||||
}
|
||||
}
|
||||
|
||||
ctx.SetOutputFiles(android.Paths{outputFile}, "")
|
||||
}
|
||||
|
||||
func usedByBootstrap(name string) bool {
|
||||
switch name {
|
||||
case "loadplugins", "soong_build":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func (g *GoBinary) HostToolPath() android.OptionalPath {
|
||||
return android.OptionalPathForPath(g.outputFile)
|
||||
}
|
||||
|
Reference in New Issue
Block a user