Support passing lint baseline to doclava

There are many issues in the docs, so allow specifying a baseline
file that allows existing lint errors in doclava.

Bug: 217734059
Test: m docs
Change-Id: I8997e47a497e1366247e8354be492805f300a16e
This commit is contained in:
Anton Hansson 2023-10-03 12:11:35 +00:00
parent 0af40657ff
commit b06bb5762e

View file

@ -136,6 +136,9 @@ type DroiddocProperties struct {
// At some point, this might be improved to show more warnings. // At some point, this might be improved to show more warnings.
Todo_file *string `android:"path"` Todo_file *string `android:"path"`
// A file containing a baseline for allowed lint errors.
Lint_baseline *string `android:"path"`
// directory under current module source that provide additional resources (images). // directory under current module source that provide additional resources (images).
Resourcesdir *string Resourcesdir *string
@ -665,6 +668,10 @@ func (d *Droiddoc) doclavaDocsFlags(ctx android.ModuleContext, cmd *android.Rule
ImplicitOutput(android.PathForModuleOut(ctx, String(d.properties.Todo_file))) ImplicitOutput(android.PathForModuleOut(ctx, String(d.properties.Todo_file)))
} }
if String(d.properties.Lint_baseline) != "" {
cmd.FlagWithInput("-lintbaseline ", android.PathForModuleSrc(ctx, String(d.properties.Lint_baseline)))
}
if String(d.properties.Resourcesdir) != "" { if String(d.properties.Resourcesdir) != "" {
// TODO: should we add files under resourcesDir to the implicits? It seems that // TODO: should we add files under resourcesDir to the implicits? It seems that
// resourcesDir is one sub dir of htmlDir // resourcesDir is one sub dir of htmlDir