aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-07-13 23:28:37 -0700
committerDan Willemsen <dwillemsen@google.com>2015-08-01 15:46:19 -0700
commit852191db67bfb39114bbef40e30d79e4e760057a (patch)
tree697474abbf973188fea20e125a84f76fcabda254
parent30b0f16728b87ceccb0da40d478c0cd2615c9f39 (diff)
downloadandroid_build_blueprint-852191db67bfb39114bbef40e30d79e4e760057a.tar.gz
android_build_blueprint-852191db67bfb39114bbef40e30d79e4e760057a.tar.bz2
android_build_blueprint-852191db67bfb39114bbef40e30d79e4e760057a.zip
Switch bootstrap.BinDir to a StaticVariable
API Change -- will require changes to any code using bootstrap.BinDir This way we can put references to other variables in BinDir, and still be used properly by other packages. Change-Id: I497424cb254b3a170401ac9420fa0adbf8d11d1e
-rw-r--r--bootstrap/bootstrap.go10
-rw-r--r--build.ninja.in24
2 files changed, 18 insertions, 16 deletions
diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go
index 7ed2a44..8f31af2 100644
--- a/bootstrap/bootstrap.go
+++ b/bootstrap/bootstrap.go
@@ -100,8 +100,8 @@ var (
},
"depfile")
- BinDir = filepath.Join(bootstrapDir, "bin")
- minibpFile = filepath.Join(BinDir, "minibp")
+ binDir = pctx.StaticVariable("BinDir", filepath.Join(bootstrapDir, "bin"))
+ minibpFile = filepath.Join("$BinDir", "minibp")
docsDir = filepath.Join(bootstrapDir, "docs")
)
@@ -296,7 +296,7 @@ func (g *goBinary) GenerateBuildActions(ctx blueprint.ModuleContext) {
objDir = moduleObjDir(ctx)
archiveFile = filepath.Join(objDir, name+".a")
aoutFile = filepath.Join(objDir, "a.out")
- binaryFile = filepath.Join(BinDir, name)
+ binaryFile = filepath.Join("$BinDir", name)
)
if len(g.properties.TestSrcs) > 0 && g.config.runGoTests {
@@ -531,7 +531,7 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
func(module blueprint.Module) {
binaryModule := module.(*goBinary)
binaryModuleName := ctx.ModuleName(binaryModule)
- binaryModulePath := filepath.Join(BinDir, binaryModuleName)
+ binaryModulePath := filepath.Join("$BinDir", binaryModuleName)
if binaryModule.BuildStage() == StageBootstrap {
rebootstrapDeps = append(rebootstrapDeps, binaryModulePath)
@@ -564,7 +564,7 @@ func (s *singleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
return
}
- primaryBuilderFile := filepath.Join(BinDir, primaryBuilderName)
+ primaryBuilderFile := filepath.Join("$BinDir", primaryBuilderName)
if s.config.runGoTests {
primaryBuilderExtraFlags += " -t"
diff --git a/build.ninja.in b/build.ninja.in
index a5a353a..8839a0d 100644
--- a/build.ninja.in
+++ b/build.ninja.in
@@ -9,6 +9,8 @@
#
ninja_required_version = 1.6.0
+g.bootstrap.BinDir = .bootstrap/bin
+
g.bootstrap.bootstrapCmd = @@Bootstrap@@
g.bootstrap.bootstrapManifest = @@BootstrapManifest@@
@@ -198,9 +200,9 @@ default .bootstrap/choosestage/obj/choosestage.a
build .bootstrap/choosestage/obj/a.out: g.bootstrap.link $
.bootstrap/choosestage/obj/choosestage.a | ${g.bootstrap.linkCmd}
default .bootstrap/choosestage/obj/a.out
-build .bootstrap/bin/choosestage: g.bootstrap.cp $
+build ${g.bootstrap.BinDir}/choosestage: g.bootstrap.cp $
.bootstrap/choosestage/obj/a.out
-default .bootstrap/bin/choosestage
+default ${g.bootstrap.BinDir}/choosestage
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Module: gotestmain
@@ -217,9 +219,9 @@ default .bootstrap/gotestmain/obj/gotestmain.a
build .bootstrap/gotestmain/obj/a.out: g.bootstrap.link $
.bootstrap/gotestmain/obj/gotestmain.a | ${g.bootstrap.linkCmd}
default .bootstrap/gotestmain/obj/a.out
-build .bootstrap/bin/gotestmain: g.bootstrap.cp $
+build ${g.bootstrap.BinDir}/gotestmain: g.bootstrap.cp $
.bootstrap/gotestmain/obj/a.out
-default .bootstrap/bin/gotestmain
+default ${g.bootstrap.BinDir}/gotestmain
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Module: minibp
@@ -246,28 +248,28 @@ build .bootstrap/minibp/obj/a.out: g.bootstrap.link $
libDirFlags = -L .bootstrap/blueprint-parser/pkg -L .bootstrap/blueprint-pathtools/pkg -L .bootstrap/blueprint-proptools/pkg -L .bootstrap/blueprint/pkg -L .bootstrap/blueprint-deptools/pkg -L .bootstrap/blueprint-bootstrap-bpdoc/pkg -L .bootstrap/blueprint-bootstrap/pkg
default .bootstrap/minibp/obj/a.out
-build .bootstrap/bin/minibp: g.bootstrap.cp .bootstrap/minibp/obj/a.out
-default .bootstrap/bin/minibp
+build ${g.bootstrap.BinDir}/minibp: g.bootstrap.cp .bootstrap/minibp/obj/a.out
+default ${g.bootstrap.BinDir}/minibp
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Singleton: bootstrap
# Factory: github.com/google/blueprint/bootstrap.funcĀ·008
rule s.bootstrap.primarybp
- command = .bootstrap/bin/minibp --build-primary ${runTests} -m ${g.bootstrap.bootstrapManifest} --timestamp ${timestamp} --timestampdep ${timestampdep} -d ${outfile}.d -o ${outfile} ${in}
+ command = ${g.bootstrap.BinDir}/minibp --build-primary ${runTests} -m ${g.bootstrap.bootstrapManifest} --timestamp ${timestamp} --timestampdep ${timestampdep} -d ${outfile}.d -o ${outfile} ${in}
depfile = ${outfile}.d
description = minibp ${outfile}
rule s.bootstrap.minibp
- command = .bootstrap/bin/minibp ${runTests} -m ${g.bootstrap.bootstrapManifest} -d ${out}.d -o ${out} ${in}
+ command = ${g.bootstrap.BinDir}/minibp ${runTests} -m ${g.bootstrap.bootstrapManifest} -d ${out}.d -o ${out} ${in}
depfile = ${out}.d
description = minibp ${out}
generator = true
build .bootstrap/primary.ninja.in .bootstrap/primary.ninja.in.timestamp: $
s.bootstrap.primarybp ${g.bootstrap.srcDir}/Blueprints | $
- .bootstrap/bin/choosestage .bootstrap/bin/gotestmain $
- .bootstrap/bin/minibp ${g.bootstrap.srcDir}/Blueprints
+ ${g.bootstrap.BinDir}/choosestage ${g.bootstrap.BinDir}/gotestmain $
+ ${g.bootstrap.BinDir}/minibp ${g.bootstrap.srcDir}/Blueprints
outfile = .bootstrap/primary.ninja.in
timestamp = .bootstrap/primary.ninja.in.timestamp
timestampdep = .bootstrap/primary.ninja.in.timestamp.d
@@ -275,7 +277,7 @@ default .bootstrap/primary.ninja.in .bootstrap/primary.ninja.in.timestamp
build .bootstrap/bootstrap.ninja.in: s.bootstrap.minibp $
${g.bootstrap.srcDir}/Blueprints | ${g.bootstrap.bootstrapManifest} $
- .bootstrap/bin/minibp
+ ${g.bootstrap.BinDir}/minibp
default .bootstrap/bootstrap.ninja.in
build .bootstrap/notAFile: phony
default .bootstrap/notAFile