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/aar.go b/java/aar.go
index e3ad252..ac7ae25 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -28,7 +28,6 @@
)
type AndroidLibraryDependency interface {
- Dependency
ExportPackage() android.Path
ExportedProguardFlagFiles() android.Paths
ExportedRRODirs() []rroDir
@@ -796,9 +795,13 @@
aapt2Link(ctx, a.exportPackage, srcJar, proguardOptionsFile, rTxt, a.extraAaptPackagesFile,
linkFlags, linkDeps, nil, overlayRes, transitiveAssets, nil)
-}
-var _ Dependency = (*AARImport)(nil)
+ ctx.SetProvider(JavaInfoProvider, JavaInfo{
+ HeaderJars: android.PathsIfNonNil(a.classpathFile),
+ ImplementationAndResourcesJars: android.PathsIfNonNil(a.classpathFile),
+ ImplementationJars: android.PathsIfNonNil(a.classpathFile),
+ })
+}
func (a *AARImport) HeaderJars() android.Paths {
return android.Paths{a.classpathFile}