Temporarily add method to get java binary tool
cc binaries are moving from out/soong/host/linux-x86/bin to
out/host/linux-86/bin first, to be followed by java binaries.
Temporarily add a method that gets the java binary path while
it is different from the cc binary path.
Bug: 204136549
Test: m checkbuild
Change-Id: I04a7e741436da6be68078f23d074870413a5bb5e
diff --git a/android/package_ctx.go b/android/package_ctx.go
index c19debb..abd0c29 100644
--- a/android/package_ctx.go
+++ b/android/package_ctx.go
@@ -177,6 +177,16 @@
})
}
+// HostJavaBinToolVariable returns a Variable whose value is the path to a host java tool
+// in the bin directory for host java targets. It may only be called during a Go
+// package's initialization - either from the init() function or as part of a
+// package-scoped variable's initialization.
+func (p PackageContext) HostJavaBinToolVariable(name, path string) blueprint.Variable {
+ return p.VariableFunc(name, func(ctx PackageVarContext) string {
+ return ctx.Config().HostJavaBinToolPath(ctx, path).String()
+ })
+}
+
// HostJNIToolVariable returns a Variable whose value is the path to a host tool
// in the lib directory for host targets. It may only be called during a Go
// package's initialization - either from the init() function or as part of a