summaryrefslogtreecommitdiff
path: root/java/lint.go
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2022-08-16 21:23:12 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-08-16 21:23:12 +0000
commit48ec5b302a79bbf6e9729779b2c150213950a103 (patch)
tree6f9ac28b8f4b8373c1ce19a28520e927573bd978 /java/lint.go
parent79845f9ccee3411fa7add6261ffd34d8b990b8b4 (diff)
parentd57e8b2c2a55359c86def86a06dfdc7f7678d3c3 (diff)
Merge "Add lint test property"
Diffstat (limited to 'java/lint.go')
-rw-r--r--java/lint.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/java/lint.go b/java/lint.go
index c609a5f44..67746204e 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -61,6 +61,11 @@ type LintProperties struct {
// If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
Strict_updatability_linting *bool
+
+ // Treat the code in this module as test code for @VisibleForTesting enforcement.
+ // This will be true by default for test module types, false otherwise.
+ // If soong gets support for testonly, this flag should be replaced with that.
+ Test *bool
}
}
@@ -74,7 +79,6 @@ type linter struct {
classpath android.Paths
classes android.Path
extraLintCheckJars android.Paths
- test bool
library bool
minSdkVersion int
targetSdkVersion int
@@ -229,7 +233,7 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext, rule *android.Ru
if l.library {
cmd.Flag("--library")
}
- if l.test {
+ if proptools.BoolDefault(l.properties.Lint.Test, false) {
cmd.Flag("--test")
}
if l.manifest != nil {