summaryrefslogtreecommitdiff
path: root/android/singleton.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2020-06-04 13:25:17 -0700
committer Colin Cross <ccross@android.com> 2020-06-09 14:38:50 -0700
commitc3d87d31129405975f9a889e3c1c96cdcbe275a4 (patch)
tree24d500cb6ae5657f11a552ec167b496a43d6563f /android/singleton.go
parent2fce23ae6d0e66c00940fd249845c4880b478092 (diff)
Define Soong phony rules in Make
To support dist-for-goals in Soong, we need to define all phony rules in Make so that dist-for-goals can insert additional dependencies on them. Collect all the phony rules in phonySingleton and write them out as Make rules when Soong is embedded in Make, or as blueprint.Phony rules when Soong is run standalone. Test: m checkbuild Change-Id: I68201eff30744b0f487fc4f11f033767b53a627d
Diffstat (limited to 'android/singleton.go')
-rw-r--r--android/singleton.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/android/singleton.go b/android/singleton.go
index 568398cdd..2c51c6c48 100644
--- a/android/singleton.go
+++ b/android/singleton.go
@@ -36,6 +36,12 @@ type SingletonContext interface {
Variable(pctx PackageContext, name, value string)
Rule(pctx PackageContext, name string, params blueprint.RuleParams, argNames ...string) blueprint.Rule
Build(pctx PackageContext, params BuildParams)
+
+ // Phony creates a Make-style phony rule, a rule with no commands that can depend on other
+ // phony rules or real files. Phony can be called on the same name multiple times to add
+ // additional dependencies.
+ Phony(name string, deps ...Path)
+
RequireNinjaVersion(major, minor, micro int)
// SetNinjaBuildDir sets the value of the top-level "builddir" Ninja variable
@@ -156,6 +162,10 @@ func (s *singletonContextAdaptor) Build(pctx PackageContext, params BuildParams)
}
+func (s *singletonContextAdaptor) Phony(name string, deps ...Path) {
+ addPhony(s.Config(), name, deps...)
+}
+
func (s *singletonContextAdaptor) SetNinjaBuildDir(pctx PackageContext, value string) {
s.SingletonContext.SetNinjaBuildDir(pctx.PackageContext, value)
}