aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-07-25 15:51:50 -0700
committerDan Willemsen <dwillemsen@google.com>2016-07-25 15:51:50 -0700
commitc98e55b0af69dfdf8e45dd11f13724430422a53a (patch)
tree0392fcfae8fa4e08f0c6a8a2f37ee529b8b7ba8c
parent15371ad6522eaa0a35340c6acec3c2b6dc311281 (diff)
downloadandroid_build_blueprint-c98e55b0af69dfdf8e45dd11f13724430422a53a.tar.gz
android_build_blueprint-c98e55b0af69dfdf8e45dd11f13724430422a53a.tar.bz2
android_build_blueprint-c98e55b0af69dfdf8e45dd11f13724430422a53a.zip
Expose ModuleType to Singletons
In order to implement some build statistics in Soong, expose the module type (the string used to define the module) to singletons. Change-Id: I441d12c7782bcf338b3654cfe907b8d2a7253594
-rw-r--r--context.go5
-rw-r--r--singleton_ctx.go5
2 files changed, 10 insertions, 0 deletions
diff --git a/context.go b/context.go
index 4e05ac8..b512106 100644
--- a/context.go
+++ b/context.go
@@ -2366,6 +2366,11 @@ func (c *Context) ModuleSubDir(logicModule Module) string {
return module.variantName
}
+func (c *Context) ModuleType(logicModule Module) string {
+ module := c.moduleInfo[logicModule]
+ return module.typeName
+}
+
func (c *Context) BlueprintFile(logicModule Module) string {
module := c.moduleInfo[logicModule]
return module.relBlueprintsFile
diff --git a/singleton_ctx.go b/singleton_ctx.go
index e761e77..007e180 100644
--- a/singleton_ctx.go
+++ b/singleton_ctx.go
@@ -28,6 +28,7 @@ type SingletonContext interface {
ModuleName(module Module) string
ModuleDir(module Module) string
ModuleSubDir(module Module) string
+ ModuleType(module Module) string
BlueprintFile(module Module) string
ModuleErrorf(module Module, format string, args ...interface{})
@@ -93,6 +94,10 @@ func (s *singletonContext) ModuleSubDir(logicModule Module) string {
return s.context.ModuleSubDir(logicModule)
}
+func (s *singletonContext) ModuleType(logicModule Module) string {
+ return s.context.ModuleType(logicModule)
+}
+
func (s *singletonContext) BlueprintFile(logicModule Module) string {
return s.context.BlueprintFile(logicModule)
}