aboutsummaryrefslogtreecommitdiffstats
path: root/singleton_ctx.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-12-09 18:06:23 -0800
committerDan Willemsen <dwillemsen@google.com>2015-12-09 18:06:23 -0800
commit265d92c7fa10ca0545215f18403bc1c4880334fc (patch)
tree2fb64d165aa8cd05e79f88238eddb69dccde25ab /singleton_ctx.go
parente8b63ad172f5ce5316cbf0193c9fcaab7575aadf (diff)
downloadandroid_build_blueprint-265d92c7fa10ca0545215f18403bc1c4880334fc.tar.gz
android_build_blueprint-265d92c7fa10ca0545215f18403bc1c4880334fc.tar.bz2
android_build_blueprint-265d92c7fa10ca0545215f18403bc1c4880334fc.zip
Add SingletonContext.Failed()
Identical to ModuleContext.Failed(), just returns whether there has been an error added to the context.
Diffstat (limited to 'singleton_ctx.go')
-rw-r--r--singleton_ctx.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/singleton_ctx.go b/singleton_ctx.go
index 2ba0199..8a0f3cc 100644
--- a/singleton_ctx.go
+++ b/singleton_ctx.go
@@ -31,6 +31,7 @@ type SingletonContext interface {
ModuleErrorf(module Module, format string, args ...interface{})
Errorf(format string, args ...interface{})
+ Failed() bool
Variable(pctx PackageContext, name, value string)
Rule(pctx PackageContext, name string, params RuleParams, argNames ...string) Rule
@@ -96,6 +97,10 @@ func (s *singletonContext) Errorf(format string, args ...interface{}) {
s.errs = append(s.errs, fmt.Errorf(format, args...))
}
+func (s *singletonContext) Failed() bool {
+ return len(s.errs) > 0
+}
+
func (s *singletonContext) Variable(pctx PackageContext, name, value string) {
s.scope.ReparentTo(pctx)