Convert ndkSingleton, apexDepsInfoSingleton, allTeamsSingleton,
apexPrebuiltInfo to use ModuleProxy.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I77b05e8b54843bfa8b91376a6796c2b5c69be3c1
diff --git a/apex/apex.go b/apex/apex.go
index 6e4685b..4dd3d4c 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2258,6 +2258,11 @@
a.enforcePartitionTagOnApexSystemServerJar(ctx)
a.verifyNativeImplementationLibs(ctx)
+
+ android.SetProvider(ctx, android.ApexBundleDepsDataProvider, android.ApexBundleDepsData{
+ FlatListPath: a.FlatListPath(),
+ Updatable: a.Updatable(),
+ })
}
// Set prebuiltInfoProvider. This will be used by `apex_prebuiltinfo_singleton` to print out a metadata file
diff --git a/apex/apex_singleton.go b/apex/apex_singleton.go
index a8bd984..dabec49 100644
--- a/apex/apex_singleton.go
+++ b/apex/apex_singleton.go
@@ -90,11 +90,11 @@
func (s *apexDepsInfoSingleton) GenerateBuildActions(ctx android.SingletonContext) {
updatableFlatLists := android.Paths{}
- ctx.VisitAllModules(func(module android.Module) {
- if binaryInfo, ok := module.(android.ApexBundleDepsInfoIntf); ok {
+ ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
+ if binaryInfo, ok := android.OtherModuleProvider(ctx, module, android.ApexBundleDepsDataProvider); ok {
apexInfo, _ := android.OtherModuleProvider(ctx, module, android.ApexInfoProvider)
- if path := binaryInfo.FlatListPath(); path != nil {
- if binaryInfo.Updatable() || apexInfo.Updatable {
+ if path := binaryInfo.FlatListPath; path != nil {
+ if binaryInfo.Updatable || apexInfo.Updatable {
if strings.HasPrefix(module.String(), "com.android.") {
updatableFlatLists = append(updatableFlatLists, path)
}
@@ -160,11 +160,11 @@
func (a *apexPrebuiltInfo) GenerateBuildActions(ctx android.SingletonContext) {
prebuiltInfos := []android.PrebuiltInfo{}
- ctx.VisitAllModules(func(m android.Module) {
+ ctx.VisitAllModuleProxies(func(m android.ModuleProxy) {
prebuiltInfo, exists := android.OtherModuleProvider(ctx, m, android.PrebuiltInfoProvider)
// Use prebuiltInfoProvider to filter out non apex soong modules.
// Use HideFromMake to filter out the unselected variants of a specific apex.
- if exists && !m.IsHideFromMake() {
+ if exists && !android.OtherModuleProviderOrDefault(ctx, m, android.CommonModuleInfoKey).HideFromMake {
prebuiltInfos = append(prebuiltInfos, prebuiltInfo)
}
})