aboutsummaryrefslogtreecommitdiffstats
path: root/android/androidmk.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-11-29 00:27:14 -0800
committerColin Cross <ccross@android.com>2017-11-30 00:44:11 +0000
commitaabf67968c4abc98d94bd8ccd6d612246b2fbbdc (patch)
treefa6ef71b0fd9ce7746e8a9f6b7f02e353cace36b /android/androidmk.go
parent178d5fefc0cea9d0f031c0bdee125b9d960f32c3 (diff)
downloadbuild_soong-aabf67968c4abc98d94bd8ccd6d612246b2fbbdc.tar.gz
build_soong-aabf67968c4abc98d94bd8ccd6d612246b2fbbdc.tar.bz2
build_soong-aabf67968c4abc98d94bd8ccd6d612246b2fbbdc.zip
Make *Context.Config return a Config instead of a interface{}
In Soong, a Config() method will always return a Config. Make ModuleContext, SingletonContext, TopDownMutatorContext and BottomUpMutatorContext's Config() methods explictly return a Config to avoid having to type-assert everywhere. Overriding the Config method requires duplicating the list of methods in blueprint.BaseModuleContext and blueprint.BottomUpMutatorContext, following the same pattern used by the other *Contexts. Config() obsoletes the AConfig() method used in some places, which will be cleaned up in the next patch. Test: m checkbuild Change-Id: Ibe21efde933959811d52443496967ab8ce71215e
Diffstat (limited to 'android/androidmk.go')
-rw-r--r--android/androidmk.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/android/androidmk.go b/android/androidmk.go
index aff43fab..d88ba8fa 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -60,9 +60,7 @@ func AndroidMkSingleton() Singleton {
type androidMkSingleton struct{}
func (c *androidMkSingleton) GenerateBuildActions(ctx SingletonContext) {
- config := ctx.Config().(Config)
-
- if !config.EmbeddedInMake() {
+ if !ctx.Config().EmbeddedInMake() {
return
}
@@ -74,7 +72,7 @@ func (c *androidMkSingleton) GenerateBuildActions(ctx SingletonContext) {
sort.Sort(AndroidModulesByName{androidMkModulesList, ctx})
- transMk := PathForOutput(ctx, "Android"+String(config.ProductVariables.Make_suffix)+".mk")
+ transMk := PathForOutput(ctx, "Android"+String(ctx.Config().ProductVariables.Make_suffix)+".mk")
if ctx.Failed() {
return
}
@@ -184,8 +182,7 @@ func translateAndroidMkModule(ctx SingletonContext, w io.Writer, mod blueprint.M
}
- config := ctx.Config().(Config)
- if amod.Arch().ArchType != config.Targets[amod.Os().Class][0].Arch.ArchType {
+ if amod.Arch().ArchType != ctx.Config().Targets[amod.Os().Class][0].Arch.ArchType {
prefix = "2ND_" + prefix
}
}