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
diff --git a/java/dex.go b/java/dex.go
index 24600c2..e52fdb5 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -204,8 +204,9 @@
// - prevent ProGuard stripping subclass in the support library that extends class added in the higher SDK version.
// See b/20667396
var proguardRaiseDeps classpath
- ctx.VisitDirectDepsWithTag(proguardRaiseTag, func(dep android.Module) {
- proguardRaiseDeps = append(proguardRaiseDeps, dep.(Dependency).HeaderJars()...)
+ ctx.VisitDirectDepsWithTag(proguardRaiseTag, func(m android.Module) {
+ dep := ctx.OtherModuleProvider(m, JavaInfoProvider).(JavaInfo)
+ proguardRaiseDeps = append(proguardRaiseDeps, dep.HeaderJars...)
})
r8Flags = append(r8Flags, proguardRaiseDeps.FormJavaClassPath("-libraryjars"))