e277b1554f
* stable-2.14: Bazel: Silent zip output in gerrit-antlr:query_antlr rule Change-Id: I418e46443fc3c98fbc9fac5a49fb9d10a9524306
78 lines
1.9 KiB
Python
78 lines
1.9 KiB
Python
load("//tools/bzl:genrule2.bzl", "genrule2")
|
|
load("//tools/bzl:junit.bzl", "junit_tests")
|
|
|
|
QUERY_PARSE_EXCEPTION_SRCS = [
|
|
"src/main/java/com/google/gerrit/index/query/QueryParseException.java",
|
|
"src/main/java/com/google/gerrit/index/query/QueryRequiresAuthException.java",
|
|
]
|
|
|
|
java_library(
|
|
name = "query_exception",
|
|
srcs = QUERY_PARSE_EXCEPTION_SRCS,
|
|
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",
|
|
"zip -q $$ROOT/$@ $$(find . -type f )",
|
|
]),
|
|
tools = [
|
|
"//lib/antlr:antlr-tool",
|
|
"@bazel_tools//tools/zip:zipper",
|
|
],
|
|
)
|
|
|
|
java_library(
|
|
name = "query_parser",
|
|
srcs = [":query_antlr"],
|
|
visibility = ["//gerrit-plugin-api:__pkg__"],
|
|
deps = [
|
|
":query_exception",
|
|
"//lib/antlr:java_runtime",
|
|
],
|
|
)
|
|
|
|
java_library(
|
|
name = "index",
|
|
srcs = glob(
|
|
["src/main/java/**/*.java"],
|
|
exclude = QUERY_PARSE_EXCEPTION_SRCS,
|
|
),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":query_exception",
|
|
":query_parser",
|
|
"//gerrit-common:annotations",
|
|
"//gerrit-extension-api:api",
|
|
"//gerrit-server:metrics",
|
|
"//lib:guava",
|
|
"//lib:gwtjsonrpc",
|
|
"//lib:gwtorm",
|
|
"//lib/antlr:java_runtime",
|
|
"//lib/auto:auto-value",
|
|
"//lib/jgit/org.eclipse.jgit:jgit",
|
|
"//lib/log:api",
|
|
],
|
|
)
|
|
|
|
junit_tests(
|
|
name = "index_tests",
|
|
size = "small",
|
|
srcs = glob(["src/test/java/**/*.java"]),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":index",
|
|
":query_exception",
|
|
":query_parser",
|
|
"//lib:junit",
|
|
"//lib:truth",
|
|
"//lib/antlr:java_runtime",
|
|
"//lib/jgit/org.eclipse.jgit:jgit",
|
|
],
|
|
)
|