summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2022-08-11 11:59:04 -0700
committer Chidera Olibie <colibie@google.com> 2023-03-01 13:24:49 +0000
commit2bb9c554b1945addf2796af189a198f8e58d56e1 (patch)
tree10287769c0f7b0b2a6144dbfff3d1965b351c70f /java/java.go
parentfd1f4d5b9ea55b74e296b1fa78fa9b1ae1027e2c (diff)
Add lint test property
Some libraries are only used for tests, but are not test module types. These modules get warnings about @VisibleForTesting usages when they really shouldn't. Expose a test flag that module authors can use to make lint treat a module as test code. Bug: 235339747 Test: Manually tested applying it to SystemUI-tests Change-Id: I1356749a669dc80a7725605d7159da27c9a211b4 (cherry picked from commit d57e8b2c2a55359c86def86a06dfdc7f7678d3c3) Merged-In: I1356749a669dc80a7725605d7159da27c9a211b4
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go
index 5a3a2e0a3..a07565ce5 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1251,7 +1251,7 @@ func TestFactory() android.Module {
module.Module.properties.Installable = proptools.BoolPtr(true)
module.Module.dexpreopter.isTest = true
- module.Module.linter.test = true
+ module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true)
android.InitSdkAwareModule(module)
InitJavaModule(module, android.HostAndDeviceSupported)
@@ -1267,7 +1267,7 @@ func TestHelperLibraryFactory() android.Module {
module.Module.properties.Installable = proptools.BoolPtr(true)
module.Module.dexpreopter.isTest = true
- module.Module.linter.test = true
+ module.Module.linter.properties.Lint.Test = proptools.BoolPtr(true)
InitJavaModule(module, android.HostAndDeviceSupported)
return module