Make all_apex_contributions a regular module
It was not using any of the capabilities of a singleton module,
and I think the fact that it's a singleton module is causing issues
for the base configuration change. This is also the last singleton
module in the tree, we might be able to remove them after.
Bug: 361816274
Bug: 370379708
Test: m nothing --no-skip-soong-tests
Change-Id: I6193d77837f2e55f7fb6bc41135c8f82fd506c73
diff --git a/android/apex_contributions.go b/android/apex_contributions.go
index 4cd8dda..ce34278 100644
--- a/android/apex_contributions.go
+++ b/android/apex_contributions.go
@@ -26,7 +26,7 @@
func RegisterApexContributionsBuildComponents(ctx RegistrationContext) {
ctx.RegisterModuleType("apex_contributions", apexContributionsFactory)
ctx.RegisterModuleType("apex_contributions_defaults", apexContributionsDefaultsFactory)
- ctx.RegisterSingletonModuleType("all_apex_contributions", allApexContributionsFactory)
+ ctx.RegisterModuleType("all_apex_contributions", allApexContributionsFactory)
}
type apexContributions struct {
@@ -87,10 +87,10 @@
// Based on product_config, it will create a dependency on the selected
// apex_contributions per mainline module
type allApexContributions struct {
- SingletonModuleBase
+ ModuleBase
}
-func allApexContributionsFactory() SingletonModule {
+func allApexContributionsFactory() Module {
module := &allApexContributions{}
InitAndroidModule(module)
return module
@@ -191,7 +191,7 @@
// This module type does not have any build actions.
func (a *allApexContributions) GenerateAndroidBuildActions(ctx ModuleContext) {
-}
-
-func (a *allApexContributions) GenerateSingletonBuildActions(ctx SingletonContext) {
+ if ctx.ModuleName() != "all_apex_contributions" {
+ ctx.ModuleErrorf("There can only be 1 all_apex_contributions module in build/soong")
+ }
}