Buck: upgrade to recent version

This version fixes a critical bug [1] that prevents us from simplifying
bucklets intergration. In this version, Buck only allows defining new
rule functions in files included with include_defs, not actually
instantiating rules, so we need to reshuffle some rules.

After this commit [2] "$(macro ...)" syntax is preserved for buck
macros, we need to use a backslash to send commands directly to the
shell: "\$(macro ...)". It turns out this doesn't work yet, shell
backticks seem to work though [3].

[1] https://github.com/facebook/buck/issues/182
[2] d6f3252170
[3] https://github.com/facebook/buck/issues/212

Change-Id: Ie99757bafc626d4ac2c5a75a2983d91b0c4f6d24
This commit is contained in:
David Ostrovsky 2014-10-24 01:08:01 +02:00 committed by Dave Borowitz
parent 2571776909
commit 7fc13dca82
6 changed files with 36 additions and 36 deletions

View File

@ -1 +1 @@
7608e515c2355d2e799f4b404683433fea9cc024
f0759b0bfff1368bc715371c383dfd8c873f9991

View File

@ -15,7 +15,7 @@ genrule(
' gerrit_ui/gerrit_ui.nocache.js' +
' gerrit_ui/dbg_gerrit_ui.nocache.js;' +
'unzip -qo $(location :ui_opt);' +
'mkdir -p $(dirname $OUT);' +
'mkdir -p `dirname $OUT`;' +
'zip -qr $OUT .',
deps = [
':ui_dbg',

View File

@ -56,7 +56,7 @@ def gwt_user_agent_permutations(
genrule(
name = '%s_gwtxml_gen' % gwt_name,
cmd = 'cd $TMP;' +
('mkdir -p $(dirname %s);' % gwt) +
('mkdir -p `dirname %s`;' % gwt) +
('echo "%s">%s;' % (xml, gwt)) +
'zip -qr $OUT .',
out = jar,

View File

@ -14,6 +14,12 @@ CLOSURE_COMPILER_ARGS = [
'--warning_level QUIET'
]
# https://code.google.com/p/closure-compiler/wiki/BinaryDownloads?tm=2
CLOSURE_VERSION = '20140407'
CLOSURE_COMPILER_URL = 'http://dl.google.com/closure-compiler/compiler-%s.zip' % CLOSURE_VERSION
COMPILER = 'compiler.jar'
CLOSURE_COMPILER_SHA1 = 'eeb02bfd45eb4a080b66dd423eaee4bdd1d674e9'
genrule(
name = 'css',
cmd = ';'.join([
@ -87,3 +93,29 @@ genrule(
' -v ' + SHA1,
out = ZIP,
)
java_binary(
name = 'js_minifier',
main_class = 'com.google.javascript.jscomp.CommandLineRunner',
deps = [':compiler-jar']
)
prebuilt_jar(
name = 'compiler-jar',
binary_jar = ':compiler',
)
genrule(
name = 'compiler',
cmd = 'unzip -p $(location :closure-compiler-zip) %s >$OUT' % COMPILER,
out = COMPILER,
)
genrule(
name = 'closure-compiler-zip',
cmd = '$(exe //tools:download_file)' +
' -o $OUT' +
' -u ' + CLOSURE_COMPILER_URL +
' -v ' + CLOSURE_COMPILER_SHA1,
out = 'closure-compiler.zip',
)

View File

@ -1,9 +1,3 @@
# https://code.google.com/p/closure-compiler/wiki/BinaryDownloads?tm=2
CLOSURE_VERSION = '20140407'
CLOSURE_COMPILER_URL = 'http://dl.google.com/closure-compiler/compiler-%s.zip' % CLOSURE_VERSION
COMPILER = 'compiler.jar'
CLOSURE_COMPILER_SHA1 = 'eeb02bfd45eb4a080b66dd423eaee4bdd1d674e9'
def js_minify(
name,
out,
@ -22,29 +16,3 @@ def js_minify(
srcs = srcs,
out = out,
)
java_binary(
name = 'js_minifier',
main_class = 'com.google.javascript.jscomp.CommandLineRunner',
deps = [':compiler-jar']
)
prebuilt_jar(
name = 'compiler-jar',
binary_jar = ':compiler',
)
genrule(
name = 'compiler',
cmd = 'unzip -p $(location :closure-compiler-zip) %s >$OUT' % COMPILER,
out = COMPILER,
)
genrule(
name = 'closure-compiler-zip',
cmd = '$(exe //tools:download_file)' +
' -o $OUT' +
' -u ' + CLOSURE_COMPILER_URL +
' -v ' + CLOSURE_COMPILER_SHA1,
out = 'closure-compiler.zip',
)

View File

@ -80,7 +80,7 @@ def gerrit_plugin(
type = 'plugin',
visibility = ['PUBLIC']):
from multiprocessing import cpu_count
mf_cmd = 'v=$(git describe HEAD);'
mf_cmd = 'v=`git describe HEAD`;'
if manifest_file:
mf_src = [manifest_file]
mf_cmd += 'sed "s:@VERSION@:$v:g" $SRCS >$OUT'