API Lint: Archive lint errors

Adds reported lint errors to dist. This lets us track them and
build tooling on top.

Bug: 138440867
Test: make dist droid; ls -l out/dist/apilint
Change-Id: I75629e3d9e1a53d161d844dfac121a5998429e04
This commit is contained in:
Adrian Roos 2019-11-01 13:42:39 +01:00
parent baf127ce2a
commit 3b8f1cda45
2 changed files with 9 additions and 1 deletions

View file

@ -605,10 +605,15 @@ func (dstubs *Droidstubs) AndroidMkEntries() android.AndroidMkEntries {
fmt.Fprintln(w, ".PHONY: checkapi")
fmt.Fprintln(w, "checkapi:",
dstubs.apiLintTimestamp.String())
dstubs.Name()+"-api-lint")
fmt.Fprintln(w, ".PHONY: droidcore")
fmt.Fprintln(w, "droidcore: checkapi")
if dstubs.apiLintReport != nil {
fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", dstubs.Name()+"-api-lint",
dstubs.apiLintReport.String(), "apilint/"+dstubs.Name()+"-lint-report.txt")
}
}
if dstubs.checkNullabilityWarningsTimestamp != nil {
fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-nullability-warnings")

View file

@ -1183,6 +1183,7 @@ type Droidstubs struct {
updateCurrentApiTimestamp android.WritablePath
checkLastReleasedApiTimestamp android.WritablePath
apiLintTimestamp android.WritablePath
apiLintReport android.WritablePath
checkNullabilityWarningsTimestamp android.WritablePath
@ -1535,6 +1536,8 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {
} else {
cmd.Flag("--api-lint")
}
d.apiLintReport = android.PathForModuleOut(ctx, "api_lint_report.txt")
cmd.FlagWithOutput("--report-even-if-suppressed ", d.apiLintReport)
d.inclusionAnnotationsFlags(ctx, cmd)
d.mergeAnnoDirFlags(ctx, cmd)