Convert a missed Singleton

Convert EnvSingleton to android.SingletonFactory.

Test: m checkbuild
Change-Id: Ia18b0b97718ba7c08d3f136f6f4096477d90c0f4
This commit is contained in:
Colin Cross 2017-11-28 23:55:23 -08:00
parent 44f066895d
commit 54855ddca4
3 changed files with 4 additions and 6 deletions

View File

@ -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")

View File

@ -99,5 +99,5 @@ func (ctx *Context) Register() {
registerMutators(ctx.Context, preArch, preDeps, postDeps)
ctx.RegisterSingletonType("env", EnvSingleton)
ctx.RegisterSingletonType("env", SingletonFactoryAdaptor(EnvSingleton))
}

View File

@ -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 {