blob: 076aea9ab006926c1ca19c3e109e7fe28306734b [file] [log] [blame]
David Ostrovsky20c2fd42019-08-30 10:19:56 +02001load("@rules_java//java:defs.bzl", "java_binary", "java_library")
2
David Ostrovskycefa09d2017-08-21 08:30:35 +02003package(default_visibility = ["//java/com/google/gerrit/index:__pkg__"])
Dave Borowitze47be682017-08-08 09:53:39 -04004
David Ostrovskyb81b4f72016-05-21 19:55:01 +02005[java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +01006 name = n,
7 data = ["//lib:LICENSE-antlr"],
8 exports = ["@%s//jar" % n],
David Ostrovskyb81b4f72016-05-21 19:55:01 +02009) for n in [
David Ostrovskyfa189072016-11-30 08:52:06 +010010 "antlr27",
11 "stringtemplate",
David Ostrovskyb81b4f72016-05-21 19:55:01 +020012]]
13
14java_library(
David Ostrovskye1359a32018-06-08 09:16:50 +020015 name = "java-runtime",
David Ostrovskyfa189072016-11-30 08:52:06 +010016 data = ["//lib:LICENSE-antlr"],
17 visibility = ["//visibility:public"],
David Ostrovskye1359a32018-06-08 09:16:50 +020018 exports = ["@java-runtime//jar"],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020019)
20
David Ostrovskyc9266202017-08-30 09:05:56 +020021# See https://github.com/bazelbuild/bazel/issues/3542
22# for why we need to tweak jvm flags in this rule.
David Ostrovskyb81b4f72016-05-21 19:55:01 +020023java_binary(
David Ostrovskyfa189072016-11-30 08:52:06 +010024 name = "antlr-tool",
David Ostrovskyc9266202017-08-30 09:05:56 +020025 jvm_flags = ["-XX:-UsePerfData"],
David Ostrovskyfa189072016-11-30 08:52:06 +010026 main_class = "org.antlr.Tool",
David Ostrovsky0c36f1f2017-08-21 08:24:33 +020027 visibility = ["//antlr3:__pkg__"],
David Ostrovskyfa189072016-11-30 08:52:06 +010028 runtime_deps = [":tool"],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020029)
30
31java_library(
David Ostrovskyfa189072016-11-30 08:52:06 +010032 name = "tool",
33 data = ["//lib:LICENSE-antlr"],
David Ostrovskye1359a32018-06-08 09:16:50 +020034 exports = ["@org-antlr//jar"],
David Ostrovskyfa189072016-11-30 08:52:06 +010035 runtime_deps = [
36 ":antlr27",
David Ostrovskye1359a32018-06-08 09:16:50 +020037 ":java-runtime",
David Ostrovskyfa189072016-11-30 08:52:06 +010038 ":stringtemplate",
39 ],
David Ostrovskyb81b4f72016-05-21 19:55:01 +020040)