summaryrefslogtreecommitdiff
path: root/java/lint.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2021-02-01 13:59:03 -0800
committer Colin Cross <ccross@android.com> 2021-02-09 15:36:25 -0800
commitdcf71b299ca9c85a31f9b895d8e8529d03cd7e04 (patch)
tree9010ad5f799f7df0589c824310d1e33720ca56ed /java/lint.go
parenta6cfcac7279755c76ab742f21e29f0ab3de2c7ea (diff)
Convert java.Dependency to JavaInfo provider
Export information about java dependencies through a Provider instead of accessing the module directly. Test: java_test.go Test: no changes to build.ninja Change-Id: Ifc5d566bf6f6ebc0ad399e948effaa1ef6a22876
Diffstat (limited to 'java/lint.go')
-rw-r--r--java/lint.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/java/lint.go b/java/lint.go
index cd2a904d6..c9e0cdd2f 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -276,8 +276,9 @@ func (l *linter) lint(ctx android.ModuleContext) {
extraLintCheckModules := ctx.GetDirectDepsWithTag(extraLintCheckTag)
for _, extraLintCheckModule := range extraLintCheckModules {
- if dep, ok := extraLintCheckModule.(Dependency); ok {
- l.extraLintCheckJars = append(l.extraLintCheckJars, dep.ImplementationAndResourcesJars()...)
+ if ctx.OtherModuleHasProvider(extraLintCheckModule, JavaInfoProvider) {
+ dep := ctx.OtherModuleProvider(extraLintCheckModule, JavaInfoProvider).(JavaInfo)
+ l.extraLintCheckJars = append(l.extraLintCheckJars, dep.ImplementationAndResourcesJars...)
} else {
ctx.PropertyErrorf("lint.extra_check_modules",
"%s is not a java module", ctx.OtherModuleName(extraLintCheckModule))