Fix profileCommand to remove the profile first.

This fixes a discrepancy between clean and incremental
builds exposed by
    https://android-review.googlesource.com/1671710 .

Test: m
Bug: 148067697
Change-Id: I0de078045075417a4123f7c3821c723f1e8e6b68
This commit is contained in:
Vladimir Marko
2021-04-29 09:05:18 +01:00
parent af44591fbe
commit 982e384a63

View File

@@ -134,7 +134,8 @@ func profileCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig, glo
profileInstalledPath := module.DexLocation + ".prof"
if !module.ProfileIsTextListing {
rule.Command().FlagWithOutput("touch ", profilePath)
rule.Command().Text("rm -f").Output(profilePath)
rule.Command().Text("touch").Output(profilePath)
}
cmd := rule.Command().
@@ -174,7 +175,8 @@ func bootProfileCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig,
profileInstalledPath := module.DexLocation + ".bprof"
if !module.ProfileIsTextListing {
rule.Command().FlagWithOutput("touch ", profilePath)
rule.Command().Text("rm -f").Output(profilePath)
rule.Command().Text("touch").Output(profilePath)
}
cmd := rule.Command().