From 0c36f1f74a8a080aceed3fe6115b92ebc7a9916f Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Mon, 21 Aug 2017 08:24:33 +0200 Subject: [PATCH] Move gerrit-index/antlr3 sources to top-level antlr3 directory Change-Id: I75d6bc4d7af2cb17622ef0f722f88f068509cb46 --- antlr3/BUILD | 17 +++++++++++++++++ .../com/google/gerrit/index/query/Query.g | 0 gerrit-index/BUILD | 17 +---------------- lib/antlr/BUILD | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 antlr3/BUILD rename {gerrit-index/src/main/antlr3 => antlr3}/com/google/gerrit/index/query/Query.g (100%) diff --git a/antlr3/BUILD b/antlr3/BUILD new file mode 100644 index 0000000000..4846639de7 --- /dev/null +++ b/antlr3/BUILD @@ -0,0 +1,17 @@ +load("//tools/bzl:genrule2.bzl", "genrule2") + +genrule2( + name = "query", + srcs = ["com/google/gerrit/index/query/Query.g"], + outs = ["query_antlr.srcjar"], + cmd = " && ".join([ + "$(location //lib/antlr:antlr-tool) -o $$TMP $<", + "cd $$TMP", + "$$ROOT/$(location @bazel_tools//tools/zip:zipper) cC $$ROOT/$@ $$(find *)", + ]), + tools = [ + "//lib/antlr:antlr-tool", + "@bazel_tools//tools/zip:zipper", + ], + visibility = ["//visibility:public"], +) diff --git a/gerrit-index/src/main/antlr3/com/google/gerrit/index/query/Query.g b/antlr3/com/google/gerrit/index/query/Query.g similarity index 100% rename from gerrit-index/src/main/antlr3/com/google/gerrit/index/query/Query.g rename to antlr3/com/google/gerrit/index/query/Query.g diff --git a/gerrit-index/BUILD b/gerrit-index/BUILD index 8e6744a0c6..5cda18741f 100644 --- a/gerrit-index/BUILD +++ b/gerrit-index/BUILD @@ -12,24 +12,9 @@ java_library( visibility = ["//visibility:public"], ) -genrule2( - name = "query_antlr", - srcs = ["src/main/antlr3/com/google/gerrit/index/query/Query.g"], - outs = ["query_antlr.srcjar"], - cmd = " && ".join([ - "$(location //lib/antlr:antlr-tool) -o $$TMP $<", - "cd $$TMP", - "$$ROOT/$(location @bazel_tools//tools/zip:zipper) cC $$ROOT/$@ $$(find *)", - ]), - tools = [ - "//lib/antlr:antlr-tool", - "@bazel_tools//tools/zip:zipper", - ], -) - java_library( name = "query_parser", - srcs = [":query_antlr"], + srcs = ["//antlr3:query"], visibility = ["//gerrit-plugin-api:__pkg__"], deps = [ ":query_exception", diff --git a/lib/antlr/BUILD b/lib/antlr/BUILD index 37a354e996..3642b9006a 100644 --- a/lib/antlr/BUILD +++ b/lib/antlr/BUILD @@ -22,7 +22,7 @@ java_binary( name = "antlr-tool", jvm_flags = ["-XX:-UsePerfData"], main_class = "org.antlr.Tool", - visibility = ["//gerrit-index:__pkg__"], + visibility = ["//antlr3:__pkg__"], runtime_deps = [":tool"], )