From 5aecabec5002b81381fd07d011d19ae6eaf2b556 Mon Sep 17 00:00:00 2001 From: mattgilbride Date: Tue, 29 Nov 2022 20:16:36 +0000 Subject: [PATCH] Always run AndroidGlobalLintChecker.jar with lint invocations AndroidGlobalLintChecker.jar provides a set of lint checks that should be run across the entire tree. Bug: 236558918 Test: manually tested, treehugger Change-Id: I2a868f1d78c969eefa2c29477fc8ecab1043df39 --- java/lint.go | 3 +++ java/testing.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/java/lint.go b/java/lint.go index 7a6e5d9c1..07b962912 100644 --- a/java/lint.go +++ b/java/lint.go @@ -366,6 +366,9 @@ func (l *linter) lint(ctx android.ModuleContext) { } } + l.extraLintCheckJars = append(l.extraLintCheckJars, android.PathForSource(ctx, + "prebuilts/cmdline-tools/AndroidGlobalLintChecker.jar")) + rule := android.NewRuleBuilder(pctx, ctx). Sbox(android.PathForModuleOut(ctx, "lint"), android.PathForModuleOut(ctx, "lint.sbox.textproto")). diff --git a/java/testing.go b/java/testing.go index ccbb638bf..e6f76e10d 100644 --- a/java/testing.go +++ b/java/testing.go @@ -56,6 +56,8 @@ var PrepareForTestWithJavaBuildComponents = android.GroupFixturePreparers( "build/make/target/product/security": nil, // Required to generate Java used-by API coverage "build/soong/scripts/gen_java_usedby_apex.sh": nil, + // Needed for the global lint checks provided from frameworks/base + "prebuilts/cmdline-tools/AndroidGlobalLintChecker.jar": nil, }.AddToFixture(), )