Parallelize singleton execution
Bug: 281536768
Test: manual, presubmits
Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
diff --git a/android/androidmk.go b/android/androidmk.go
index aa411d1..62f82f2 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -42,7 +42,7 @@
}
func RegisterAndroidMkBuildComponents(ctx RegistrationContext) {
- ctx.RegisterSingletonType("androidmk", AndroidMkSingleton)
+ ctx.RegisterParallelSingletonType("androidmk", AndroidMkSingleton)
}
// Enable androidmk support.
diff --git a/android/api_levels.go b/android/api_levels.go
index fa919fd..2391e6c 100644
--- a/android/api_levels.go
+++ b/android/api_levels.go
@@ -22,7 +22,7 @@
)
func init() {
- RegisterSingletonType("api_levels", ApiLevelsSingleton)
+ RegisterParallelSingletonType("api_levels", ApiLevelsSingleton)
}
const previewAPILevelBase = 9000
diff --git a/android/buildinfo_prop.go b/android/buildinfo_prop.go
index 46f6488..8e19ad5 100644
--- a/android/buildinfo_prop.go
+++ b/android/buildinfo_prop.go
@@ -23,7 +23,7 @@
func init() {
ctx := InitRegistrationContext
- ctx.RegisterSingletonModuleType("buildinfo_prop", buildinfoPropFactory)
+ ctx.RegisterParallelSingletonModuleType("buildinfo_prop", buildinfoPropFactory)
}
type buildinfoPropProperties struct {
diff --git a/android/gen_notice.go b/android/gen_notice.go
index 091345b..1acc638 100644
--- a/android/gen_notice.go
+++ b/android/gen_notice.go
@@ -28,7 +28,7 @@
// Register the gen_notice module type.
func RegisterGenNoticeBuildComponents(ctx RegistrationContext) {
- ctx.RegisterSingletonType("gen_notice_build_rules", GenNoticeBuildRulesFactory)
+ ctx.RegisterParallelSingletonType("gen_notice_build_rules", GenNoticeBuildRulesFactory)
ctx.RegisterModuleType("gen_notice", GenNoticeFactory)
}
diff --git a/android/metrics.go b/android/metrics.go
index 3d41a1d..63c72cd 100644
--- a/android/metrics.go
+++ b/android/metrics.go
@@ -42,7 +42,7 @@
}
func init() {
- RegisterSingletonType("soong_metrics", soongMetricsSingletonFactory)
+ RegisterParallelSingletonType("soong_metrics", soongMetricsSingletonFactory)
}
func soongMetricsSingletonFactory() Singleton { return soongMetricsSingleton{} }
diff --git a/android/module.go b/android/module.go
index db602a0..9024896 100644
--- a/android/module.go
+++ b/android/module.go
@@ -3724,7 +3724,7 @@
}
func init() {
- RegisterSingletonType("buildtarget", BuildTargetSingleton)
+ RegisterParallelSingletonType("buildtarget", BuildTargetSingleton)
}
func BuildTargetSingleton() Singleton {
diff --git a/android/register.go b/android/register.go
index c57964c..64b0207 100644
--- a/android/register.go
+++ b/android/register.go
@@ -231,7 +231,7 @@
func collateGloballyRegisteredSingletons() sortableComponents {
allSingletons := append(sortableComponents(nil), singletons...)
allSingletons = append(allSingletons,
- singleton{pre: false, parallel: false, name: "bazeldeps", factory: BazelSingleton},
+ singleton{pre: false, parallel: true, name: "bazeldeps", factory: BazelSingleton},
// Register phony just before makevars so it can write out its phony rules as Make rules
singleton{pre: false, parallel: false, name: "phony", factory: phonySingletonFactory},
diff --git a/android/test_suites.go b/android/test_suites.go
index b570b23..b48d71a 100644
--- a/android/test_suites.go
+++ b/android/test_suites.go
@@ -15,7 +15,7 @@
package android
func init() {
- RegisterSingletonType("testsuites", testSuiteFilesFactory)
+ RegisterParallelSingletonType("testsuites", testSuiteFilesFactory)
}
func testSuiteFilesFactory() Singleton {