Merge "Don't create withres-withoutdex files for R8" into main am: 31a5b2c1ef am: c2c6d39f72 am: 0453c9526c am: c4fa542b36

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2768496

Change-Id: Ieb987e391085fb73d5f7746572bc90bec1141eb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-10-04 18:50:58 +00:00 committed by Automerger Merge Worker
commit ec9f51069c

View file

@ -140,9 +140,7 @@ var r8, r8RE = pctx.MultiCommandRemoteStaticRules("r8",
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
`rm -f "$outDict" && rm -f "$outConfig" && rm -rf "${outUsageDir}" && ` +
`mkdir -p $$(dirname ${outUsage}) && ` +
`mkdir -p $$(dirname $tmpJar) && ` +
`${config.Zip2ZipCmd} -i $in -o $tmpJar -x '**/*.dex' && ` +
`$r8Template${config.R8Cmd} ${config.R8Flags} -injars $tmpJar --output $outDir ` +
`$r8Template${config.R8Cmd} ${config.R8Flags} -injars $in --output $outDir ` +
`--no-data-resources ` +
`-printmapping ${outDict} ` +
`-printconfiguration ${outConfig} ` +
@ -187,7 +185,7 @@ var r8, r8RE = pctx.MultiCommandRemoteStaticRules("r8",
Platform: map[string]string{remoteexec.PoolKey: "${config.REJavaPool}"},
},
}, []string{"outDir", "outDict", "outConfig", "outUsage", "outUsageZip", "outUsageDir",
"r8Flags", "zipFlags", "tmpJar", "mergeZipsFlags"}, []string{"implicits"})
"r8Flags", "zipFlags", "mergeZipsFlags"}, []string{"implicits"})
func (d *dexer) dexCommonFlags(ctx android.ModuleContext,
dexParams *compileDexParams) (flags []string, deps android.Paths) {
@ -370,7 +368,6 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
// Compile classes.jar into classes.dex and then javalib.jar
javalibJar := android.PathForModuleOut(ctx, "dex", dexParams.jarName).OutputPath
outDir := android.PathForModuleOut(ctx, "dex")
tmpJar := android.PathForModuleOut(ctx, "withres-withoutdex", dexParams.jarName)
zipFlags := "--ignore_missing_files"
if proptools.Bool(d.dexProperties.Uncompress_dex) {
@ -408,7 +405,6 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
"outUsage": proguardUsage.String(),
"outUsageZip": proguardUsageZip.String(),
"outDir": outDir.String(),
"tmpJar": tmpJar.String(),
"mergeZipsFlags": mergeZipsFlags,
}
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_R8") {
@ -428,6 +424,7 @@ func (d *dexer) compileDex(ctx android.ModuleContext, dexParams *compileDexParam
Args: args,
})
} else {
tmpJar := android.PathForModuleOut(ctx, "withres-withoutdex", dexParams.jarName)
d8Flags, d8Deps := d8Flags(dexParams.flags)
d8Deps = append(d8Deps, commonDeps...)
rule := d8