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 Cole Faust <colefaust@google.com> 2022-08-11 12:26:51 -0700
commitd57e8b2c2a55359c86def86a06dfdc7f7678d3c3 (patch)
treef8a50beb318eaecebbb3e7cd9f318357fb472cfc /java/java.go
parent50e02aaf7623b29eda65a7b3f57bbed54ef3c75b (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
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 481c625f3..77ab40279 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1262,7 +1262,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)
@@ -1278,7 +1278,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