aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2018-01-15 09:08:04 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-01-15 09:10:00 -0800
commitf2075d27ca124156fcd7c01242c552175c0cf145 (patch)
tree8759ed9a6d159cc5eecc093d0586a0d8d025b0de /src/main/java/com/google/devtools/build/lib/rules
parent1bf3e3685e124510a6a4874039a994ccf425e5ce (diff)
Export the runfiles path of the JVM executable to Skylark.
RELNOTES: None. PiperOrigin-RevId: 181973847
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntimeInfo.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntimeInfo.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntimeInfo.java
index bb4e2a854c..8488968fa0 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntimeInfo.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaRuntimeInfo.java
@@ -81,6 +81,14 @@ public class JavaRuntimeInfo extends NativeInfo {
return javaBinaryExecPath;
}
+ @SkylarkCallable(
+ name = "java_executable_runfiles_path",
+ doc = "Returns the path of the Java executable in runfiles trees. This should only be used "
+ + "when one needs to access the JVM during the execution of a binary or a test built "
+ + "by Bazel. In particular, when one needs to invoke the JVM during an action, "
+ + "java_executable_exec_path should be used instead.",
+ structField = true
+ )
/** The runfiles path of the Java binary. */
public PathFragment javaBinaryRunfilesPath() {
return javaBinaryRunfilesPath;