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
|
/gerrit-package-plugins
|
||||||
/.buckconfig.local
|
/.buckconfig.local
|
||||||
/.buckd
|
/.buckd
|
||||||
|
/buck-cache
|
||||||
/buck-out
|
/buck-out
|
||||||
/local.properties
|
/local.properties
|
||||||
|
@ -46,7 +46,7 @@ def genasciidoc(
|
|||||||
)
|
)
|
||||||
genrule(
|
genrule(
|
||||||
name = name,
|
name = name,
|
||||||
cmd = '',
|
cmd = ':>$OUT',
|
||||||
srcs = [],
|
srcs = [],
|
||||||
deps = [':' + o for o in outs],
|
deps = [':' + o for o in outs],
|
||||||
out = name + '__done',
|
out = name + '__done',
|
||||||
|
@ -216,6 +216,23 @@ being built, or in `~/.gerritcodereview/`. The file in the root of the gerrit
|
|||||||
repository has precedence.
|
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
|
Build Process Switch Exit Criteria
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@ ANTLR_OUTS = [
|
|||||||
'QueryParser.java',
|
'QueryParser.java',
|
||||||
]
|
]
|
||||||
PARSER_DEPS = [
|
PARSER_DEPS = [
|
||||||
':query_antlr',
|
|
||||||
':query_exception',
|
':query_exception',
|
||||||
'//lib/antlr:java_runtime',
|
'//lib/antlr:java_runtime',
|
||||||
]
|
]
|
||||||
@ -24,7 +23,7 @@ genantlr(
|
|||||||
java_library(
|
java_library(
|
||||||
name = 'lib',
|
name = 'lib',
|
||||||
srcs = [genfile(f) for f in ANTLR_OUTS],
|
srcs = [genfile(f) for f in ANTLR_OUTS],
|
||||||
deps = PARSER_DEPS,
|
deps = PARSER_DEPS + [':' + f for f in ANTLR_OUTS],
|
||||||
)
|
)
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
|
16
tools/DEFS
16
tools/DEFS
@ -16,13 +16,25 @@ def genantlr(
|
|||||||
name,
|
name,
|
||||||
srcs,
|
srcs,
|
||||||
outs):
|
outs):
|
||||||
|
tmp = name + '.srcjar'
|
||||||
genrule(
|
genrule(
|
||||||
name = name,
|
name = name,
|
||||||
srcs = srcs,
|
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'],
|
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(
|
def gwt_module(
|
||||||
name,
|
name,
|
||||||
|
Loading…
Reference in New Issue
Block a user