gerrit/gerrit-antlr/BUCK
Shawn Pearce 11d27c8ee8 Update Buck
Latest version of buck is faster than the prior version used by
Gerrit.  No-op updates when loading a debug version of the UI now take
only 1.804s on my laptop (previously 7s) and a draft UI compile is
only 24.659s (previously 39s).

The slow acceptance tests must now be excluded with `--exclude slow`.
Buck changed the meaning of the -e option to be --emulator, which is
unfortunately useful only for Android application developers.

genrule() now needs to use $(exe) to reference the binary to run,
offers $(location) to make it easier to find files in the build tree.

The empty srcs array is no longer required for genrule().  Buck has
determined it is sufficiently powerful with $(location) and deps that
requiring srcs is unnecessary.

Supporting .src.zip files in the srcs array of java_library() means
Gerrit no longer needs to run a separate genrule() to extract files
produced by ANTLR, or call javac inside of the BuckPrologCompiler
support glue.

Change-Id: Ib03042921a081b867a7aad0423bd45523e42917a
2013-07-26 18:11:51 -07:00

37 lines
820 B
Python

PARSER_DEPS = [
':query_exception',
'//lib/antlr:java_runtime',
]
java_library(
name = 'query_exception',
srcs = ['src/main/java/com/google/gerrit/server/query/QueryParseException.java'],
visibility = ['PUBLIC'],
)
genantlr(
name = 'query_antlr',
srcs = ['src/main/antlr3/com/google/gerrit/server/query/Query.g'],
out = 'query_antlr.src.zip',
)
java_library(
name = 'lib',
srcs = [genfile('query_antlr.src.zip')],
deps = PARSER_DEPS + [':query_antlr'],
)
# Hack necessary to expose ANTLR generated code as JAR to Eclipse.
genrule(
name = 'query_link',
cmd = 'ln -s $(location :lib) $OUT',
deps = [':lib'],
out = 'query_parser.jar',
)
prebuilt_jar(
name = 'query_parser',
binary_jar = genfile('query_parser.jar'),
deps = PARSER_DEPS + [':query_link'],
visibility = ['PUBLIC'],
)