summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author LaMont Jones <lamontjones@google.com> 2025-02-20 13:49:07 -0800
committer LaMont Jones <lamontjones@google.com> 2025-02-20 13:49:07 -0800
commit61d14fa7dd2278f7748c4b551b00ec685eddcb79 (patch)
tree076004b9bab3c41466fd0cdca95c10004b424a13
parentebc3d69b42a6bf6efb7571afb9d0991531db13cf (diff)
Avoid duplicate rules for profile.prof.txt files
Bug: b/374975543 Test: manual, TH Change-Id: I3bdc4df420456c476c143a5249fb130aa0b2c42e
-rw-r--r--java/dex.go19
1 files changed, 7 insertions, 12 deletions
diff --git a/java/dex.go b/java/dex.go
index c9d3f376d..f121aeaba 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -583,7 +583,6 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
var description string
var artProfileOutputPath *android.OutputPath
var implicitOutputs android.WritablePaths
- var flags []string
var deps android.Paths
args := map[string]string{
"zipFlags": zipFlags,
@@ -610,18 +609,13 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
description = "r8"
debugMode := android.InList("--debug", commonFlags)
r8Flags, r8Deps, r8ArtProfileOutputPath := d.r8Flags(ctx, dexParams, debugMode)
- flags = append(flags, r8Flags...)
deps = append(deps, r8Deps...)
args["r8Flags"] = strings.Join(append(commonFlags, r8Flags...), " ")
if r8ArtProfileOutputPath != nil {
artProfileOutputPath = r8ArtProfileOutputPath
- implicitOutputs = append(
- implicitOutputs,
- artProfileOutputPath,
- )
// Add the implicit r8 Art profile output to args so that r8RE knows
// about this implicit output
- args["outR8ArtProfile"] = artProfileOutputPath.String()
+ args["outR8ArtProfile"] = r8ArtProfileOutputPath.String()
}
args["outDict"] = proguardDictionary.String()
args["outConfig"] = proguardConfiguration.String()
@@ -642,16 +636,11 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
if useD8 {
description = "d8"
d8Flags, d8Deps, d8ArtProfileOutputPath := d.d8Flags(ctx, dexParams)
- flags = append(flags, d8Flags...)
deps = append(deps, d8Deps...)
deps = append(deps, commonDeps...)
args["d8Flags"] = strings.Join(append(commonFlags, d8Flags...), " ")
if d8ArtProfileOutputPath != nil {
artProfileOutputPath = d8ArtProfileOutputPath
- implicitOutputs = append(
- implicitOutputs,
- artProfileOutputPath,
- )
}
// If we are generating both d8 and r8, only use RBE when both are enabled.
switch {
@@ -667,6 +656,12 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
rule = d8
}
}
+ if artProfileOutputPath != nil {
+ implicitOutputs = append(
+ implicitOutputs,
+ artProfileOutputPath,
+ )
+ }
ctx.Build(pctx, android.BuildParams{
Rule: rule,
Description: description,