Merge changes from topic "met-html" into sc-dev

* changes:
  Remove sourcepath argument from metalava invocations
  Stop filtering html files from droidstubs input
This commit is contained in:
Anton Hansson 2021-06-10 12:22:17 +00:00 committed by Android (Google) Code Review
commit e7db515506
2 changed files with 3 additions and 38 deletions

View File

@ -425,23 +425,6 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
} }
srcFiles = filterByPackage(srcFiles, j.properties.Filter_packages) srcFiles = filterByPackage(srcFiles, j.properties.Filter_packages)
// While metalava needs package html files, it does not need them to be explicit on the command
// line. javadoc complains if it receives html files on the command line. The filter
// below excludes html files from the rsp file metalava. Note that the html
// files are still included as implicit inputs for successful remote execution and correct
// incremental builds.
filterHtml := func(srcs []android.Path) []android.Path {
filtered := []android.Path{}
for _, src := range srcs {
if src.Ext() == ".html" {
continue
}
filtered = append(filtered, src)
}
return filtered
}
srcFiles = filterHtml(srcFiles)
aidlFlags := j.collectAidlFlags(ctx, deps) aidlFlags := j.collectAidlFlags(ctx, deps)
srcFiles = j.genSources(ctx, srcFiles, aidlFlags) srcFiles = j.genSources(ctx, srcFiles, aidlFlags)

View File

@ -393,22 +393,11 @@ func (d *Droidstubs) apiLevelsAnnotationsFlags(ctx android.ModuleContext, cmd *a
} }
func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersion javaVersion, srcs android.Paths, func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersion javaVersion, srcs android.Paths,
srcJarList android.Path, bootclasspath, classpath classpath, sourcepaths android.Paths, srcJarList android.Path, bootclasspath, classpath classpath, homeDir android.WritablePath) *android.RuleBuilderCommand {
homeDir android.WritablePath) *android.RuleBuilderCommand {
rule.Command().Text("rm -rf").Flag(homeDir.String()) rule.Command().Text("rm -rf").Flag(homeDir.String())
rule.Command().Text("mkdir -p").Flag(homeDir.String()) rule.Command().Text("mkdir -p").Flag(homeDir.String())
var cmd *android.RuleBuilderCommand cmd := rule.Command()
if len(sourcepaths) > 0 {
// We are passing the sourcepaths as an argument to metalava below, but the directories may
// not exist already (if they do not contain any listed inputs for metalava). Note that this
// is in a rule.SboxInputs()rule, so we are not modifying the actual source tree by creating
// these directories.
cmd = rule.Command()
cmd.Text("mkdir -p").Flags(cmd.PathsForInputs(sourcepaths))
}
cmd = rule.Command()
cmd.FlagWithArg("ANDROID_PREFS_ROOT=", homeDir.String()) cmd.FlagWithArg("ANDROID_PREFS_ROOT=", homeDir.String())
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_METALAVA") { if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_METALAVA") {
@ -441,13 +430,6 @@ func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersi
cmd.FlagWithInputList("-classpath ", classpath.Paths(), ":") cmd.FlagWithInputList("-classpath ", classpath.Paths(), ":")
} }
if len(sourcepaths) > 0 {
// TODO(b/153703940): Pass .html files to metalava and remove this argument.
cmd.FlagWithList("-sourcepath ", sourcepaths.Strings(), ":")
} else {
cmd.FlagWithArg("-sourcepath ", `""`)
}
cmd.Flag("--no-banner"). cmd.Flag("--no-banner").
Flag("--color"). Flag("--color").
Flag("--quiet"). Flag("--quiet").
@ -491,7 +473,7 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {
homeDir := android.PathForModuleOut(ctx, "metalava", "home") homeDir := android.PathForModuleOut(ctx, "metalava", "home")
cmd := metalavaCmd(ctx, rule, javaVersion, d.Javadoc.srcFiles, srcJarList, cmd := metalavaCmd(ctx, rule, javaVersion, d.Javadoc.srcFiles, srcJarList,
deps.bootClasspath, deps.classpath, d.Javadoc.sourcepaths, homeDir) deps.bootClasspath, deps.classpath, homeDir)
cmd.Implicits(d.Javadoc.implicits) cmd.Implicits(d.Javadoc.implicits)
d.stubsFlags(ctx, cmd, stubsDir) d.stubsFlags(ctx, cmd, stubsDir)