aboutsummaryrefslogtreecommitdiffstats
path: root/singleton_ctx.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-11-18 16:01:01 -0800
committerColin Cross <ccross@android.com>2015-11-18 16:06:19 -0800
commita259945b744f6f367c24ff01594412ee8147d454 (patch)
tree8cfd9fb6fdbae411b88554e987cfdb19f49bd21b /singleton_ctx.go
parent01739302cbf3c26e28bd8dcecc7dc90ae0bbdfc0 (diff)
downloadandroid_build_blueprint-a259945b744f6f367c24ff01594412ee8147d454.tar.gz
android_build_blueprint-a259945b744f6f367c24ff01594412ee8147d454.tar.bz2
android_build_blueprint-a259945b744f6f367c24ff01594412ee8147d454.zip
Use context builddir for removing abandoned files
Removing abandoned files needs to know where the .ninja_log file is stored. Export the ninja builddir value from Context and use it to determine the .ninja_log path in any stage. The ninja builddir (where ninja stores its .ninja_log and .ninja_deps files) and the bootstrap.BuildDir (where build output files are written) are distinct, so to reduce confusion replace SetBuildDir with SetNinjaBuildDir.
Diffstat (limited to 'singleton_ctx.go')
-rw-r--r--singleton_ctx.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/singleton_ctx.go b/singleton_ctx.go
index c4c0b6c..ee96fc6 100644
--- a/singleton_ctx.go
+++ b/singleton_ctx.go
@@ -37,11 +37,10 @@ type SingletonContext interface {
Build(pctx *PackageContext, params BuildParams)
RequireNinjaVersion(major, minor, micro int)
- // SetBuildDir sets the value of the top-level "builddir" Ninja variable
+ // SetNinjaBuildDir sets the value of the top-level "builddir" Ninja variable
// that controls where Ninja stores its build log files. This value can be
- // set at most one time for a single build. Setting it multiple times (even
- // across different singletons) will result in a panic.
- SetBuildDir(pctx *PackageContext, value string)
+ // set at most one time for a single build, later calls are ignored.
+ SetNinjaBuildDir(pctx *PackageContext, value string)
VisitAllModules(visit func(Module))
VisitAllModulesIf(pred func(Module) bool, visit func(Module))
@@ -138,7 +137,7 @@ func (s *singletonContext) RequireNinjaVersion(major, minor, micro int) {
s.context.requireNinjaVersion(major, minor, micro)
}
-func (s *singletonContext) SetBuildDir(pctx *PackageContext, value string) {
+func (s *singletonContext) SetNinjaBuildDir(pctx *PackageContext, value string) {
s.scope.ReparentTo(pctx)
ninjaValue, err := parseNinjaString(s.scope, value)
@@ -146,7 +145,7 @@ func (s *singletonContext) SetBuildDir(pctx *PackageContext, value string) {
panic(err)
}
- s.context.setBuildDir(ninjaValue)
+ s.context.setNinjaBuildDir(ninjaValue)
}
func (s *singletonContext) VisitAllModules(visit func(Module)) {