39dcd91570
* stable-2.14: Minor improvements in receive.maxObjectSizeLimit documentation Bazel: Consume rules_closure from HEAD Bump auto-value to 1.6.2 Change-Id: I401942a40c5001300f77f9437d342001cd42e619
79 lines
2.0 KiB
Python
79 lines
2.0 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/auto:auto-value-annotations",
|
|
"//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",
|
|
],
|
|
)
|