Merge "Fix genantlr() to support buck caching"
This commit is contained in:
commit
7d1adf840b
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,5 +9,6 @@
|
||||
/gerrit-package-plugins
|
||||
/.buckconfig.local
|
||||
/.buckd
|
||||
/buck-cache
|
||||
/buck-out
|
||||
/local.properties
|
||||
|
@ -46,7 +46,7 @@ def genasciidoc(
|
||||
)
|
||||
genrule(
|
||||
name = name,
|
||||
cmd = '',
|
||||
cmd = ':>$OUT',
|
||||
srcs = [],
|
||||
deps = [':' + o for o in outs],
|
||||
out = name + '__done',
|
||||
|
@ -216,6 +216,23 @@ being built, or in `~/.gerritcodereview/`. The file in the root of the gerrit
|
||||
repository has precedence.
|
||||
|
||||
|
||||
Caching Build Results
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Build results can be locally cached, saving rebuild time when
|
||||
switching between Git branches. Buck's documentation covers
|
||||
caching in link:http://facebook.github.io/buck/concept/buckconfig.html[buckconfig].
|
||||
The trivial case using a local directory is:
|
||||
|
||||
----
|
||||
cat >.buckconfig.local <<EOF
|
||||
[cache]
|
||||
mode = dir
|
||||
dir = buck-cache
|
||||
EOF
|
||||
----
|
||||
|
||||
|
||||
Build Process Switch Exit Criteria
|
||||
----------------------------------
|
||||
|
||||
|
@ -3,7 +3,6 @@ ANTLR_OUTS = [
|
||||
'QueryParser.java',
|
||||
]
|
||||
PARSER_DEPS = [
|
||||
':query_antlr',
|
||||
':query_exception',
|
||||
'//lib/antlr:java_runtime',
|
||||
]
|
||||
@ -24,7 +23,7 @@ genantlr(
|
||||
java_library(
|
||||
name = 'lib',
|
||||
srcs = [genfile(f) for f in ANTLR_OUTS],
|
||||
deps = PARSER_DEPS,
|
||||
deps = PARSER_DEPS + [':' + f for f in ANTLR_OUTS],
|
||||
)
|
||||
|
||||
genrule(
|
||||
|
16
tools/DEFS
16
tools/DEFS
@ -16,13 +16,25 @@ def genantlr(
|
||||
name,
|
||||
srcs,
|
||||
outs):
|
||||
tmp = name + '.srcjar'
|
||||
genrule(
|
||||
name = name,
|
||||
srcs = srcs,
|
||||
cmd = '${//lib/antlr:antlr-tool} -o $(dirname $OUT) $SRCS',
|
||||
cmd = '${//lib/antlr:antlr-tool} -o $TMP $SRCS;' +
|
||||
'cd $TMP;' +
|
||||
'zip -qr $OUT .',
|
||||
deps = ['//lib/antlr:antlr-tool'],
|
||||
out = outs[0],
|
||||
out = tmp,
|
||||
)
|
||||
for o in outs:
|
||||
genrule(
|
||||
name = o,
|
||||
cmd = 'unzip -qp $SRCS %s >$OUT' % o,
|
||||
srcs = [genfile(tmp)],
|
||||
deps = [':' + name],
|
||||
out = o,
|
||||
)
|
||||
|
||||
|
||||
def gwt_module(
|
||||
name,
|
||||
|
Loading…
Reference in New Issue
Block a user