Change depVisitor to use providers instead of type-asserting to
interfaces directly, the next step is to change it to use ModuleProxy
once IsDepInSameApex is ready.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I13a4e256a26dbf7f9b3b746d628ac8f68b4e598e
diff --git a/java/sdk_library.go b/java/sdk_library.go
index cf31b50..7944bb2 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -702,7 +702,7 @@
paths.stubsHeaderPath = lib.HeaderJars
paths.stubsImplPath = lib.ImplementationJars
- libDep := android.OtherModuleProviderOrDefault(ctx, dep, JavaInfoProvider).UsesLibraryDependencyInfo
+ libDep := android.OtherModuleProviderOrDefault(ctx, dep, JavaInfoProvider)
paths.stubsDexJarPath = libDep.DexJarBuildPath
paths.exportableStubsDexJarPath = libDep.DexJarBuildPath
return nil
@@ -718,7 +718,7 @@
paths.stubsImplPath = lib.ImplementationJars
}
- libDep := android.OtherModuleProviderOrDefault(ctx, dep, JavaInfoProvider).UsesLibraryDependencyInfo
+ libDep := android.OtherModuleProviderOrDefault(ctx, dep, JavaInfoProvider)
paths.stubsDexJarPath = libDep.DexJarBuildPath
return nil
} else {
@@ -732,7 +732,7 @@
paths.stubsImplPath = lib.ImplementationJars
}
- libDep := android.OtherModuleProviderOrDefault(ctx, dep, JavaInfoProvider).UsesLibraryDependencyInfo
+ libDep := android.OtherModuleProviderOrDefault(ctx, dep, JavaInfoProvider)
paths.exportableStubsDexJarPath = libDep.DexJarBuildPath
return nil
} else {
@@ -1017,10 +1017,6 @@
removedApiFilePaths[kind] = removedApiFilePath
}
- javaInfo := &JavaInfo{}
- setExtraJavaInfo(ctx, ctx.Module(), javaInfo)
- android.SetProvider(ctx, JavaInfoProvider, javaInfo)
-
return SdkLibraryInfo{
EverythingStubDexJarPaths: everythingStubPaths,
ExportableStubDexJarPaths: exportableStubPaths,
@@ -1227,6 +1223,8 @@
// Whether if this can be used as a shared library.
SharedLibrary bool
+
+ Prebuilt bool
}
var SdkLibraryInfoProvider = blueprint.NewProvider[SdkLibraryInfo]()
@@ -1513,10 +1511,10 @@
module.dexJarFile = makeDexJarPathFromPath(module.implLibraryInfo.DexJarFile.Path())
module.headerJarFile = module.implLibraryInfo.HeaderJars[0]
module.implementationAndResourcesJar = module.implLibraryInfo.ImplementationAndResourcesJars[0]
- module.apexSystemServerDexpreoptInstalls = module.implLibraryInfo.ApexSystemServerDexpreoptInstalls
- module.apexSystemServerDexJars = module.implLibraryInfo.ApexSystemServerDexJars
+ module.apexSystemServerDexpreoptInstalls = module.implLibraryInfo.DexpreopterInfo.ApexSystemServerDexpreoptInstalls
+ module.apexSystemServerDexJars = module.implLibraryInfo.DexpreopterInfo.ApexSystemServerDexJars
module.dexpreopter.configPath = module.implLibraryInfo.ConfigPath
- module.dexpreopter.outputProfilePathOnHost = module.implLibraryInfo.OutputProfilePathOnHost
+ module.dexpreopter.outputProfilePathOnHost = module.implLibraryInfo.DexpreopterInfo.OutputProfilePathOnHost
// Properties required for Library.AndroidMkEntries
module.logtagsSrcs = module.implLibraryInfo.LogtagsSrcs
@@ -1582,7 +1580,12 @@
setOutputFilesFromJavaInfo(ctx, module.implLibraryInfo)
}
+ javaInfo := &JavaInfo{}
+ setExtraJavaInfo(ctx, ctx.Module(), javaInfo)
+ android.SetProvider(ctx, JavaInfoProvider, javaInfo)
+
sdkLibInfo.GeneratingLibs = generatingLibs
+ sdkLibInfo.Prebuilt = false
android.SetProvider(ctx, SdkLibraryInfoProvider, sdkLibInfo)
}
@@ -2236,7 +2239,12 @@
setOutputFilesFromJavaInfo(ctx, module.implLibraryInfo)
}
+ javaInfo := &JavaInfo{}
+ setExtraJavaInfo(ctx, ctx.Module(), javaInfo)
+ android.SetProvider(ctx, JavaInfoProvider, javaInfo)
+
sdkLibInfo.GeneratingLibs = generatingLibs
+ sdkLibInfo.Prebuilt = true
android.SetProvider(ctx, SdkLibraryInfoProvider, sdkLibInfo)
}