aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar xingao <xingao@google.com>2017-11-01 13:03:40 -0400
committerGravatar John Cater <jcater@google.com>2017-11-02 10:04:04 -0400
commit1f0f1f1cd0d76af1b9a3cc9ee7c9a5a5717766b6 (patch)
treecbe1153858e7c6241318539226febc346efc61cf
parent4ad39f1301f29b1024e6c970765ab9721cac8be0 (diff)
Enable switching singlejar and ijar targets for remote execution.
When --define EXECUTOR=remote is specified in bazel command, embedded tool singlejar and ijar will be compiled remotely from source. PiperOrigin-RevId: 174195094
-rw-r--r--src/BUILD6
-rw-r--r--tools/jdk/BUILD10
2 files changed, 14 insertions, 2 deletions
diff --git a/src/BUILD b/src/BUILD
index 3c227b5a51..a5f025ccc7 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -385,6 +385,12 @@ config_setting(
visibility = ["//visibility:public"],
)
+config_setting(
+ name = "remote",
+ values = {"define": "EXECUTOR=remote"},
+ visibility = ["//visibility:public"],
+)
+
filegroup(
name = "srcs",
srcs = glob(["**"]) + [
diff --git a/tools/jdk/BUILD b/tools/jdk/BUILD
index 97eb22ad36..75aa5e46f6 100644
--- a/tools/jdk/BUILD
+++ b/tools/jdk/BUILD
@@ -73,7 +73,10 @@ alias(
# contains the appropriate platform-dependent file.
filegroup(
name = "ijar",
- srcs = glob(["ijar/*"]),
+ srcs = select({
+ "//src:remote": ["//third_party/ijar:ijar"],
+ "//conditions:default": glob(["ijar/*"]),
+ }),
)
# On Windows, Java implementation of singlejar is used. We create a little
@@ -84,7 +87,10 @@ filegroup(
# must be platform-independent.
filegroup(
name = "singlejar",
- srcs = glob(["singlejar/*"]),
+ srcs = select({
+ "//src:remote": ["//src/tools/singlejar:singlejar"],
+ "//conditions:default": glob(["singlejar/*"]),
+ }),
)
filegroup(