summaryrefslogtreecommitdiff
path: root/java/dex.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/dex.go')
-rw-r--r--java/dex.go34
1 files changed, 22 insertions, 12 deletions
diff --git a/java/dex.go b/java/dex.go
index c9d3f376d..ed2df2103 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -435,6 +435,11 @@ func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams,
android.PathForSource(ctx, "build/make/core/proguard.flags"),
}
+ if ctx.Config().UseR8GlobalCheckNotNullFlags() {
+ flagFiles = append(flagFiles, android.PathForSource(ctx,
+ "build/make/core/proguard/checknotnull.flags"))
+ }
+
flagFiles = append(flagFiles, d.extraProguardFlagsFiles...)
// TODO(ccross): static android library proguard files
@@ -583,7 +588,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 +614,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 +641,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 +661,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,
@@ -697,3 +697,13 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
return javalibJar, artProfileOutputPath
}
+
+type ProguardInfo struct {
+ ModuleName string
+ Class string
+ ProguardDictionary android.Path
+ ProguardUsageZip android.Path
+ ClassesJar android.Path
+}
+
+var ProguardProvider = blueprint.NewProvider[ProguardInfo]()