From 54855ddca4b5d1d939f104ef1866af81d2f83434 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 28 Nov 2017 23:55:23 -0800 Subject: [PATCH] Convert a missed Singleton Convert EnvSingleton to android.SingletonFactory. Test: m checkbuild Change-Id: Ia18b0b97718ba7c08d3f136f6f4096477d90c0f4 --- android/env.go | 6 ++---- android/register.go | 2 +- android/testing.go | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/android/env.go b/android/env.go index ec5794e36..c03431b20 100644 --- a/android/env.go +++ b/android/env.go @@ -19,8 +19,6 @@ import ( "strings" "android/soong/env" - - "github.com/google/blueprint" ) // This file supports dependencies on environment variables. During build manifest generation, @@ -43,13 +41,13 @@ func init() { 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 78ae481c1..6c88af11e 100644 --- a/android/register.go +++ b/android/register.go @@ -99,5 +99,5 @@ func (ctx *Context) Register() { 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 f12c032f9..60189d3d9 100644 --- a/android/testing.go +++ b/android/testing.go @@ -61,7 +61,7 @@ func (ctx *TestContext) PostDepsMutators(f RegisterMutatorFunc) { 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 {