Convert a missed Singleton
Convert EnvSingleton to android.SingletonFactory.
Test: m checkbuild
Change-Id: Ia18b0b97718ba7c08d3f136f6f4096477d90c0f4
diff --git a/android/env.go b/android/env.go
index ec5794e..c03431b 100644
--- a/android/env.go
+++ b/android/env.go
@@ -19,8 +19,6 @@
"strings"
"android/soong/env"
-
- "github.com/google/blueprint"
)
// This file supports dependencies on environment variables. During build manifest generation,
@@ -43,13 +41,13 @@
os.Clearenv()
}
-func EnvSingleton() blueprint.Singleton {
+func EnvSingleton() Singleton {
return &envSingleton{}
}
type envSingleton struct{}
-func (c *envSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
+func (c *envSingleton) GenerateBuildActions(ctx SingletonContext) {
envDeps := ctx.Config().(Config).EnvDeps()
envFile := PathForOutput(ctx, ".soong.environment")
diff --git a/android/register.go b/android/register.go
index 78ae481..6c88af1 100644
--- a/android/register.go
+++ b/android/register.go
@@ -99,5 +99,5 @@
registerMutators(ctx.Context, preArch, preDeps, postDeps)
- ctx.RegisterSingletonType("env", EnvSingleton)
+ ctx.RegisterSingletonType("env", SingletonFactoryAdaptor(EnvSingleton))
}
diff --git a/android/testing.go b/android/testing.go
index f12c032..60189d3 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -61,7 +61,7 @@
func (ctx *TestContext) Register() {
registerMutators(ctx.Context, ctx.preArch, ctx.preDeps, ctx.postDeps)
- ctx.RegisterSingletonType("env", EnvSingleton)
+ ctx.RegisterSingletonType("env", SingletonFactoryAdaptor(EnvSingleton))
}
func (ctx *TestContext) ModuleForTests(name, variant string) TestingModule {