Wrap PackageContext and SingletonContext
Wrap blueprint.PackageContext so that the *Func methods can provide
an android.Config instead of an interface{}. The modified signatures
means that every method in ModuleContext and SingletonContext
that takes a blueprint.PackageContext now needs to be wrapped to
take an android.PackageContext.
SingletonContext wasn't previously wrapped at all, but as long
as it is, wrap everything like ModuleContext does. This requires
updating every Singleton to use the android-specific methods.
Test: builds, all Soong tests pass
Change-Id: I4f22085ebca7def6c5cde49e8210b59d994ba625
diff --git a/android/makevars.go b/android/makevars.go
index 024e015..d323613 100644
--- a/android/makevars.go
+++ b/android/makevars.go
@@ -21,7 +21,6 @@
"os"
"strconv"
- "github.com/google/blueprint"
"github.com/google/blueprint/proptools"
)
@@ -66,7 +65,7 @@
type MakeVarsProvider func(ctx MakeVarsContext)
-func RegisterMakeVarsProvider(pctx blueprint.PackageContext, provider MakeVarsProvider) {
+func RegisterMakeVarsProvider(pctx PackageContext, provider MakeVarsProvider) {
makeVarsProviders = append(makeVarsProviders, makeVarsProvider{pctx, provider})
}
@@ -76,14 +75,14 @@
RegisterSingletonType("makevars", makeVarsSingletonFunc)
}
-func makeVarsSingletonFunc() blueprint.Singleton {
+func makeVarsSingletonFunc() Singleton {
return &makeVarsSingleton{}
}
type makeVarsSingleton struct{}
type makeVarsProvider struct {
- pctx blueprint.PackageContext
+ pctx PackageContext
call MakeVarsProvider
}
@@ -91,8 +90,8 @@
type makeVarsContext struct {
config Config
- ctx blueprint.SingletonContext
- pctx blueprint.PackageContext
+ ctx SingletonContext
+ pctx PackageContext
vars []makeVarsVariable
}
@@ -105,7 +104,7 @@
strict bool
}
-func (s *makeVarsSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
+func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) {
config := ctx.Config().(Config)
if !config.EmbeddedInMake() {