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:
parent
2571776909
commit
7fc13dca82
@ -1 +1 @@
|
|||||||
7608e515c2355d2e799f4b404683433fea9cc024
|
f0759b0bfff1368bc715371c383dfd8c873f9991
|
||||||
|
@ -15,7 +15,7 @@ genrule(
|
|||||||
' gerrit_ui/gerrit_ui.nocache.js' +
|
' gerrit_ui/gerrit_ui.nocache.js' +
|
||||||
' gerrit_ui/dbg_gerrit_ui.nocache.js;' +
|
' gerrit_ui/dbg_gerrit_ui.nocache.js;' +
|
||||||
'unzip -qo $(location :ui_opt);' +
|
'unzip -qo $(location :ui_opt);' +
|
||||||
'mkdir -p $(dirname $OUT);' +
|
'mkdir -p `dirname $OUT`;' +
|
||||||
'zip -qr $OUT .',
|
'zip -qr $OUT .',
|
||||||
deps = [
|
deps = [
|
||||||
':ui_dbg',
|
':ui_dbg',
|
||||||
|
@ -56,7 +56,7 @@ def gwt_user_agent_permutations(
|
|||||||
genrule(
|
genrule(
|
||||||
name = '%s_gwtxml_gen' % gwt_name,
|
name = '%s_gwtxml_gen' % gwt_name,
|
||||||
cmd = 'cd $TMP;' +
|
cmd = 'cd $TMP;' +
|
||||||
('mkdir -p $(dirname %s);' % gwt) +
|
('mkdir -p `dirname %s`;' % gwt) +
|
||||||
('echo "%s">%s;' % (xml, gwt)) +
|
('echo "%s">%s;' % (xml, gwt)) +
|
||||||
'zip -qr $OUT .',
|
'zip -qr $OUT .',
|
||||||
out = jar,
|
out = jar,
|
||||||
|
@ -14,6 +14,12 @@ CLOSURE_COMPILER_ARGS = [
|
|||||||
'--warning_level QUIET'
|
'--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(
|
genrule(
|
||||||
name = 'css',
|
name = 'css',
|
||||||
cmd = ';'.join([
|
cmd = ';'.join([
|
||||||
@ -87,3 +93,29 @@ genrule(
|
|||||||
' -v ' + SHA1,
|
' -v ' + SHA1,
|
||||||
out = ZIP,
|
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',
|
||||||
|
)
|
||||||
|
@ -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(
|
def js_minify(
|
||||||
name,
|
name,
|
||||||
out,
|
out,
|
||||||
@ -22,29 +16,3 @@ def js_minify(
|
|||||||
srcs = srcs,
|
srcs = srcs,
|
||||||
out = out,
|
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',
|
|
||||||
)
|
|
||||||
|
@ -80,7 +80,7 @@ def gerrit_plugin(
|
|||||||
type = 'plugin',
|
type = 'plugin',
|
||||||
visibility = ['PUBLIC']):
|
visibility = ['PUBLIC']):
|
||||||
from multiprocessing import cpu_count
|
from multiprocessing import cpu_count
|
||||||
mf_cmd = 'v=$(git describe HEAD);'
|
mf_cmd = 'v=`git describe HEAD`;'
|
||||||
if manifest_file:
|
if manifest_file:
|
||||||
mf_src = [manifest_file]
|
mf_src = [manifest_file]
|
||||||
mf_cmd += 'sed "s:@VERSION@:$v:g" $SRCS >$OUT'
|
mf_cmd += 'sed "s:@VERSION@:$v:g" $SRCS >$OUT'
|
||||||
|
Loading…
Reference in New Issue
Block a user