Allow Singletons to export Make variables

Register any Singletons that implement a MakeVars method as
MakeVarsProviders, and convert the hiddenapi singleton to
use it.

Test: m checkbuild
Change-Id: I6a2044ad34ef46a8b267762ddfeb51aa01d7734d
This commit is contained in:
Colin Cross
2019-02-19 12:38:45 -08:00
parent 454c087be6
commit ed023eca73
3 changed files with 54 additions and 24 deletions

View File

@@ -58,6 +58,9 @@ type SingletonFactory func() Singleton
func SingletonFactoryAdaptor(factory SingletonFactory) blueprint.SingletonFactory {
return func() blueprint.Singleton {
singleton := factory()
if makevars, ok := singleton.(SingletonMakeVarsProvider); ok {
registerSingletonMakeVarsProvider(makevars)
}
return singletonAdaptor{singleton}
}
}