From c8d60bc7c6a02af0e936a69275d23579c22f4368 Mon Sep 17 00:00:00 2001 From: Ramy Medhat Date: Thu, 4 Jun 2020 01:54:07 -0400 Subject: [PATCH] Turn on metalava sandbox warning in all droiddoc metalava invocations. Test: built aosp crosshatch userdebug with RBE_METALAVA=1 and dependency file support. Change-Id: I5ca637984429df12fe05bb07f5db154be9b24f97 --- java/droiddoc.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/java/droiddoc.go b/java/droiddoc.go index b16c9cd72..1b279ccbf 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -1427,10 +1427,9 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi rule.HighMem() cmd := rule.Command() - rspFile := "" + var implicitsRsp android.WritablePath if len(implicits) > 0 { - implicitsRsp := android.PathForModuleOut(ctx, ctx.ModuleName()+"-"+"implicits.rsp") - rspFile = implicitsRsp.String() + implicitsRsp = android.PathForModuleOut(ctx, ctx.ModuleName()+"-"+"implicits.rsp") impRule := android.NewRuleBuilder() impCmd := impRule.Command() // A dummy action that copies the ninja generated rsp file to a new location. This allows us to @@ -1457,10 +1456,10 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi inputs = append(inputs, strings.Split(v, ",")...) } cmd.Text((&remoteexec.REParams{ - Labels: map[string]string{"type": "compile", "lang": "java", "compiler": "metalava"}, + Labels: map[string]string{"type": "compile", "lang": "java", "compiler": "metalava", "shallow": "true"}, ExecStrategy: execStrategy, Inputs: inputs, - RSPFile: rspFile, + RSPFile: implicitsRsp.String(), ToolchainInputs: []string{config.JavaCmd(ctx).String()}, Platform: map[string]string{remoteexec.PoolKey: pool}, }).NoVarTemplate(ctx.Config())) @@ -1471,7 +1470,12 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi FlagWithArg("-encoding ", "UTF-8"). FlagWithArg("-source ", javaVersion.String()). FlagWithRspFileInputList("@", srcs). - FlagWithInput("@", srcJarList) + FlagWithInput("@", srcJarList). + FlagWithOutput("--strict-input-files:warn ", android.PathForModuleOut(ctx, ctx.ModuleName()+"-"+"violations.txt")) + + if implicitsRsp.String() != "" { + cmd.FlagWithArg("--strict-input-files-exempt ", "@"+implicitsRsp.String()) + } if len(bootclasspath) > 0 { cmd.FlagWithInputList("-bootclasspath ", bootclasspath.Paths(), ":")