Start using blueprint_go_binary

And install the tools into a more obvious location. soong_env is not
moved, since we need it to exist early, so that we can use it in
soong.bash in case there's a build failure.

Change-Id: I9bd1fa320d84d180b2cf3deb90782d380666f7a6
diff --git a/Android.bp b/Android.bp
index 344d62b..0010256 100644
--- a/Android.bp
+++ b/Android.bp
@@ -44,7 +44,7 @@
 }
 
 
-bootstrap_go_binary {
+blueprint_go_binary {
     name: "soong_glob",
     deps: [
         "soong-glob",
@@ -166,7 +166,7 @@
     pluginFor: ["soong_build"],
 }
 
-bootstrap_go_binary {
+blueprint_go_binary {
     name: "soong_jar",
     srcs: [
         "cmd/soong_jar/soong_jar.go",
@@ -199,7 +199,7 @@
 // androidmk Android.mk to Blueprints translator
 //
 
-bootstrap_go_binary {
+blueprint_go_binary {
     name: "androidmk",
     srcs: [
         "androidmk/cmd/androidmk/android.go",
diff --git a/android/config.go b/android/config.go
index 8701960..ee95d2e 100644
--- a/android/config.go
+++ b/android/config.go
@@ -197,6 +197,10 @@
 	return false
 }
 
+func (c *config) BlueprintToolLocation() string {
+	return filepath.Join(c.buildDir, "host", c.PrebuiltOS(), "bin")
+}
+
 // PrebuiltOS returns the name of the host OS used in prebuilts directories
 func (c *config) PrebuiltOS() string {
 	switch runtime.GOOS {
diff --git a/android/glob.go b/android/glob.go
index aec5fa9..34b3de4 100644
--- a/android/glob.go
+++ b/android/glob.go
@@ -39,7 +39,7 @@
 // in a build failure with a "missing and no known rule to make it" error.
 
 var (
-	globCmd = filepath.Join("${bootstrap.BinDir}", "soong_glob")
+	globCmd = filepath.Join("${bootstrap.ToolDir}", "soong_glob")
 
 	// globRule rule traverses directories to produce a list of files that match $glob
 	// and writes it to $out if it has changed, and writes the directories to $out.d
diff --git a/java/builder.go b/java/builder.go
index 5269893..d41abc1 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -90,7 +90,7 @@
 	pctx.Import("github.com/google/blueprint/bootstrap")
 	pctx.StaticVariable("commonJdkFlags", "-source 1.7 -target 1.7 -Xmaxerrs 9999999")
 	pctx.StaticVariable("javacCmd", "javac -J-Xmx1024M $commonJdkFlags")
-	pctx.StaticVariable("jarCmd", filepath.Join("${bootstrap.BinDir}", "soong_jar"))
+	pctx.StaticVariable("jarCmd", filepath.Join("${bootstrap.ToolDir}", "soong_jar"))
 	pctx.HostBinToolVariable("dxCmd", "dx")
 	pctx.HostJavaToolVariable("jarjarCmd", "jarjar.jar")
 }