Merge pull request #49 from danw/plugins

Implement go bootstrap plugins
diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go
index c9f1b68..eebd59c 100644
--- a/bootstrap/bootstrap.go
+++ b/bootstrap/bootstrap.go
@@ -23,8 +23,8 @@
 	"github.com/google/blueprint/pathtools"
 )
 
-const bootstrapDir = "$buildDir/.bootstrap"
-const miniBootstrapDir = "$buildDir/.minibootstrap"
+const bootstrapSubDir = ".bootstrap"
+const miniBootstrapSubDir = ".minibootstrap"
 
 var (
 	pctx = blueprint.NewPackageContext("github.com/google/blueprint/bootstrap")
@@ -110,6 +110,9 @@
 	minibpFile = filepath.Join("$BinDir", "minibp")
 
 	docsDir = filepath.Join(bootstrapDir, "docs")
+
+	bootstrapDir = filepath.Join("$buildDir", bootstrapSubDir)
+	miniBootstrapDir = filepath.Join("$buildDir", miniBootstrapSubDir)
 )
 
 type bootstrapGoCore interface {
diff --git a/bootstrap/cleanup.go b/bootstrap/cleanup.go
index 1e1fc03..89c4b3e 100644
--- a/bootstrap/cleanup.go
+++ b/bootstrap/cleanup.go
@@ -32,12 +32,12 @@
 func removeAbandonedFiles(ctx *blueprint.Context, config *Config,
 	srcDir, manifestFile string) error {
 
-	buildDir := "."
+	buildDir := BuildDir
 	switch config.stage {
 	case StageBootstrap:
-		buildDir = miniBootstrapDir
+		buildDir = filepath.Join(buildDir, miniBootstrapSubDir)
 	case StagePrimary:
-		buildDir = bootstrapDir
+		buildDir = filepath.Join(buildDir, bootstrapSubDir)
 	}
 
 	targetRules, err := ctx.AllTargets()
diff --git a/bootstrap/command.go b/bootstrap/command.go
index cf88666..6a19262 100644
--- a/bootstrap/command.go
+++ b/bootstrap/command.go
@@ -170,6 +170,7 @@
 
 func fatalf(format string, args ...interface{}) {
 	fmt.Printf(format, args...)
+	fmt.Print("\n")
 	os.Exit(1)
 }