Merge "Check UseRBE is set before replacing any template with the RE version."

This commit is contained in:
Kousik Kumar 2020-09-10 09:24:17 +00:00 committed by Gerrit Code Review
commit 3e0b9c031c
7 changed files with 15 additions and 15 deletions

View File

@ -656,7 +656,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
a.container_certificate_file,
a.container_private_key_file,
}
if ctx.Config().IsEnvTrue("RBE_SIGNAPK") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_SIGNAPK") {
rule = java.SignapkRE
args["implicits"] = strings.Join(implicits.Strings(), ",")
args["outCommaList"] = a.outputFile.String()

View File

@ -584,7 +584,7 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
tidyFiles = append(tidyFiles, tidyFile)
rule := clangTidy
if ctx.Config().IsEnvTrue("RBE_CLANG_TIDY") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CLANG_TIDY") {
rule = clangTidyRE
}
@ -610,7 +610,7 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
sAbiDumpFiles = append(sAbiDumpFiles, sAbiDumpFile)
dumpRule := sAbiDump
if ctx.Config().IsEnvTrue("RBE_ABI_DUMPER") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_ABI_DUMPER") {
dumpRule = sAbiDumpRE
}
ctx.Build(pctx, android.BuildParams{
@ -745,7 +745,7 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
"ldFlags": flags.globalLdFlags + " " + flags.localLdFlags,
"crtEnd": crtEnd.String(),
}
if ctx.Config().IsEnvTrue("RBE_CXX_LINKS") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") {
rule = ldRE
args["implicitOutputs"] = strings.Join(implicitOutputs.Strings(), ",")
args["implicitInputs"] = strings.Join(deps.Strings(), ",")
@ -789,7 +789,7 @@ func TransformDumpToLinkedDump(ctx android.ModuleContext, sAbiDumps android.Path
"arch": ctx.Arch().ArchType.Name,
"exportedHeaderFlags": exportedHeaderFlags,
}
if ctx.Config().IsEnvTrue("RBE_ABI_LINKER") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_ABI_LINKER") {
rule = sAbiLinkRE
rbeImplicits := implicits.Strings()
for _, p := range strings.Split(exportedHeaderFlags, " ") {
@ -912,7 +912,7 @@ func TransformObjsToObj(ctx android.ModuleContext, objFiles android.Paths,
"ldCmd": ldCmd,
"ldFlags": flags.globalLdFlags + " " + flags.localLdFlags,
}
if ctx.Config().IsEnvTrue("RBE_CXX_LINKS") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_CXX_LINKS") {
rule = partialLdRE
args["inCommaList"] = strings.Join(objFiles.Strings(), ",")
args["implicitInputs"] = strings.Join(deps.Strings(), ",")

View File

@ -97,7 +97,7 @@ func SignAppPackage(ctx android.ModuleContext, signedApk android.WritablePath, u
"certificates": strings.Join(certificateArgs, " "),
"flags": strings.Join(flags, " "),
}
if ctx.Config().IsEnvTrue("RBE_SIGNAPK") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_SIGNAPK") {
rule = SignapkRE
args["implicits"] = strings.Join(deps.Strings(), ",")
args["outCommaList"] = strings.Join(outputFiles.Strings(), ",")
@ -236,7 +236,7 @@ func TransformJniLibsToJar(ctx android.ModuleContext, outputFile android.Writabl
args := map[string]string{
"jarArgs": strings.Join(proptools.NinjaAndShellEscapeList(jarArgs), " "),
}
if ctx.Config().IsEnvTrue("RBE_ZIP") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_ZIP") {
rule = zipRE
args["implicits"] = strings.Join(deps.Strings(), ",")
}

View File

@ -385,7 +385,7 @@ func TransformJavaToHeaderClasses(ctx android.ModuleContext, outputFile android.
"outDir": android.PathForModuleOut(ctx, "turbine", "classes").String(),
"javaVersion": flags.javaVersion.String(),
}
if ctx.Config().IsEnvTrue("RBE_TURBINE") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_TURBINE") {
rule = turbineRE
args["implicits"] = strings.Join(deps.Strings(), ",")
}
@ -452,7 +452,7 @@ func transformJavaToClasses(ctx android.ModuleContext, outputFile android.Writab
annoDir = filepath.Join(shardDir, annoDir)
}
rule := javac
if ctx.Config().IsEnvTrue("RBE_JAVAC") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_JAVAC") {
rule = javacRE
}
ctx.Build(pctx, android.BuildParams{
@ -480,7 +480,7 @@ func TransformResourcesToJar(ctx android.ModuleContext, outputFile android.Writa
jarArgs []string, deps android.Paths) {
rule := jar
if ctx.Config().IsEnvTrue("RBE_JAR") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_JAR") {
rule = jarRE
}
ctx.Build(pctx, android.BuildParams{

View File

@ -288,7 +288,7 @@ func (d *dexer) compileDex(ctx android.ModuleContext, flags javaBuilderFlags, mi
"outUsageZip": proguardUsageZip.String(),
"outDir": outDir.String(),
}
if ctx.Config().IsEnvTrue("RBE_R8") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_R8") {
rule = r8RE
args["implicits"] = strings.Join(r8Deps.Strings(), ",")
}
@ -304,7 +304,7 @@ func (d *dexer) compileDex(ctx android.ModuleContext, flags javaBuilderFlags, mi
} else {
d8Flags, d8Deps := d8Flags(flags)
rule := d8
if ctx.Config().IsEnvTrue("RBE_D8") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_D8") {
rule = d8RE
}
ctx.Build(pctx, android.BuildParams{

View File

@ -1464,7 +1464,7 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
// Metalava uses lots of memory, restrict the number of metalava jobs that can run in parallel.
rule.HighMem()
cmd := rule.Command()
if ctx.Config().IsEnvTrue("RBE_METALAVA") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_METALAVA") {
rule.Remoteable(android.RemoteRuleSupports{RBE: true})
pool := ctx.Config().GetenvWithDefault("RBE_METALAVA_POOL", "metalava")
execStrategy := ctx.Config().GetenvWithDefault("RBE_METALAVA_EXEC_STRATEGY", remoteexec.LocalExecStrategy)

View File

@ -1490,7 +1490,7 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
args := map[string]string{
"jarArgs": "-P META-INF/services/ " + strings.Join(proptools.NinjaAndShellEscapeList(zipargs), " "),
}
if ctx.Config().IsEnvTrue("RBE_ZIP") {
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_ZIP") {
rule = zipRE
args["implicits"] = strings.Join(services.Strings(), ",")
}