summaryrefslogtreecommitdiff
path: root/java/dex.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/dex.go')
-rw-r--r--java/dex.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/java/dex.go b/java/dex.go
index 1f71aee1a..dea71f538 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -428,17 +428,18 @@ type compileDexParams struct {
// Adds --art-profile to r8/d8 command.
// r8/d8 will output a generated profile file to match the optimized dex code.
func (d *dexer) addArtProfile(ctx android.ModuleContext, dexParams *compileDexParams) (flags []string, deps android.Paths, artProfileOutputPath *android.OutputPath) {
- if dexParams.artProfileInput != nil {
- artProfileInputPath := android.PathForModuleSrc(ctx, *dexParams.artProfileInput)
- artProfileOutputPathValue := android.PathForModuleOut(ctx, "profile.prof.txt").OutputPath
- artProfileOutputPath = &artProfileOutputPathValue
- flags = []string{
- "--art-profile",
- artProfileInputPath.String(),
- artProfileOutputPath.String(),
- }
- deps = append(deps, artProfileInputPath)
+ if dexParams.artProfileInput == nil {
+ return nil, nil, nil
+ }
+ artProfileInputPath := android.PathForModuleSrc(ctx, *dexParams.artProfileInput)
+ artProfileOutputPathValue := android.PathForModuleOut(ctx, "profile.prof.txt").OutputPath
+ artProfileOutputPath = &artProfileOutputPathValue
+ flags = []string{
+ "--art-profile",
+ artProfileInputPath.String(),
+ artProfileOutputPath.String(),
}
+ deps = append(deps, artProfileInputPath)
return flags, deps, artProfileOutputPath
}