From 4e9f5923c0e7cf0d7f845b90c7da65c24e44bcee Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 13 Nov 2024 16:09:23 -0800 Subject: Use fewer OutputPaths A lot of the time, you really mean android.Path or android.WriteablePath instead of OutputPath. Also, many modules were holding onto OutputPaths/WriteablePaths after the files had already been generated, meaning they should no longer be treated as writable paths and are instead inputs into other actions. Change the type of those paths to just android.Path. Test: verified ninja files were unchanged on aosp_arm64-trunk_staging-userdebug Change-Id: Id773171bef59d855ba33c4b85cef268031cbec39 --- java/dex.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'java/dex.go') 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 } -- cgit v1.2.3-59-g8ed1b