David Ostrovsky | 20c2fd4 | 2019-08-30 10:19:56 +0200 | [diff] [blame] | 1 | load("@rules_java//java:defs.bzl", "java_binary", "java_library") |
| 2 | |
David Ostrovsky | cefa09d | 2017-08-21 08:30:35 +0200 | [diff] [blame] | 3 | package(default_visibility = ["//java/com/google/gerrit/index:__pkg__"]) |
Dave Borowitz | e47be68 | 2017-08-08 09:53:39 -0400 | [diff] [blame] | 4 | |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 5 | [java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 6 | name = n, |
| 7 | data = ["//lib:LICENSE-antlr"], |
| 8 | exports = ["@%s//jar" % n], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 9 | ) for n in [ |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 10 | "antlr27", |
| 11 | "stringtemplate", |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 12 | ]] |
| 13 | |
| 14 | java_library( |
David Ostrovsky | e1359a3 | 2018-06-08 09:16:50 +0200 | [diff] [blame] | 15 | name = "java-runtime", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 16 | data = ["//lib:LICENSE-antlr"], |
| 17 | visibility = ["//visibility:public"], |
David Ostrovsky | e1359a3 | 2018-06-08 09:16:50 +0200 | [diff] [blame] | 18 | exports = ["@java-runtime//jar"], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 19 | ) |
| 20 | |
David Ostrovsky | c926620 | 2017-08-30 09:05:56 +0200 | [diff] [blame] | 21 | # See https://github.com/bazelbuild/bazel/issues/3542 |
| 22 | # for why we need to tweak jvm flags in this rule. |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 23 | java_binary( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 24 | name = "antlr-tool", |
David Ostrovsky | c926620 | 2017-08-30 09:05:56 +0200 | [diff] [blame] | 25 | jvm_flags = ["-XX:-UsePerfData"], |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 26 | main_class = "org.antlr.Tool", |
David Ostrovsky | 0c36f1f | 2017-08-21 08:24:33 +0200 | [diff] [blame] | 27 | visibility = ["//antlr3:__pkg__"], |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 28 | runtime_deps = [":tool"], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 29 | ) |
| 30 | |
| 31 | java_library( |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 32 | name = "tool", |
| 33 | data = ["//lib:LICENSE-antlr"], |
David Ostrovsky | e1359a3 | 2018-06-08 09:16:50 +0200 | [diff] [blame] | 34 | exports = ["@org-antlr//jar"], |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 35 | runtime_deps = [ |
| 36 | ":antlr27", |
David Ostrovsky | e1359a3 | 2018-06-08 09:16:50 +0200 | [diff] [blame] | 37 | ":java-runtime", |
David Ostrovsky | fa18907 | 2016-11-30 08:52:06 +0100 | [diff] [blame] | 38 | ":stringtemplate", |
| 39 | ], |
David Ostrovsky | b81b4f7 | 2016-05-21 19:55:01 +0200 | [diff] [blame] | 40 | ) |