Convert the following singletons to use ModuleProxy:
buildTargetSingleton
exportedJavaDeclarationsLibrarySingleton
javaFuzzPackager
kytheExtractAllSingleton
kytheExtractJavaSingleton
kytheExtractRustSingleton
lintSingleton
logtagsSingleton
makeVarsSingleton
ndkAbiDiffSingleton
ndkAbiDumpSingleton
phonySingleton
platformCompatConfigSingleton
sdkSingleton
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I625ac8a209ca93755b2ba232202cfb44ecefde0a
diff --git a/cc/ndk_abi.go b/cc/ndk_abi.go
index 2706261..a9f26a4 100644
--- a/cc/ndk_abi.go
+++ b/cc/ndk_abi.go
@@ -39,15 +39,15 @@
func (n *ndkAbiDumpSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var depPaths android.Paths
- ctx.VisitAllModules(func(module android.Module) {
- if !module.Enabled(ctx) {
+ ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
return
}
- if m, ok := module.(*Module); ok {
- if installer, ok := m.installer.(*stubDecorator); ok {
- if installer.hasAbiDump {
- depPaths = append(depPaths, installer.abiDumpPath)
+ if ccInfo, ok := android.OtherModuleProvider(ctx, module, CcInfoProvider); ok {
+ if ccInfo.InstallerInfo != nil && ccInfo.InstallerInfo.StubDecoratorInfo != nil {
+ if ccInfo.InstallerInfo.StubDecoratorInfo.HasAbiDump {
+ depPaths = append(depPaths, ccInfo.InstallerInfo.StubDecoratorInfo.AbiDumpPath)
}
}
}
@@ -77,14 +77,14 @@
func (n *ndkAbiDiffSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var depPaths android.Paths
- ctx.VisitAllModules(func(module android.Module) {
- if m, ok := module.(android.Module); ok && !m.Enabled(ctx) {
+ ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
+ if !android.OtherModuleProviderOrDefault(ctx, module, android.CommonModuleInfoKey).Enabled {
return
}
- if m, ok := module.(*Module); ok {
- if installer, ok := m.installer.(*stubDecorator); ok {
- depPaths = append(depPaths, installer.abiDiffPaths...)
+ if ccInfo, ok := android.OtherModuleProvider(ctx, module, CcInfoProvider); ok {
+ if ccInfo.InstallerInfo != nil && ccInfo.InstallerInfo.StubDecoratorInfo != nil {
+ depPaths = append(depPaths, ccInfo.InstallerInfo.StubDecoratorInfo.AbiDiffPaths...)
}
}
})