gerrit/tools/BUCK
Dave Borowitz 9a4efd3fff Merge Lucene core and backward-codecs jars
Both of these jars provide a provider-configuration file in
META-INF/services/org.apache.lucene.codecs.Codec registering their
respective implementations as providers of this codec. The proper way
to merge these files is to concatenate them, but the normal Buck build
process would otherwise choose one arbitrarily.

Add a new custom rule merge_maven_jars to merge multiple Maven jars
together using a simple Python script. The script concatenates all the
entries in two zip files, preferring the entry found in the first file
on the command line, which is still arbitrary but at least
deterministic. It specially handles files in the META-INF/services
directory by concatenating them.

Use this new rule to merge the old :core and :backward-codecs rules
into a single :core-and-backward-codecs rule.

Change-Id: I42fd1a130e42cb0eebf7bee61cfdf8545397cd09
2015-09-01 14:34:25 -04:00

53 lines
873 B
Python

python_binary(
name = 'download_file',
main = 'download_file.py',
deps = [':util'],
visibility = ['PUBLIC'],
)
python_binary(
name = 'merge_jars',
main = 'merge_jars.py',
visibility = ['PUBLIC'],
)
python_binary(
name = 'pack_war',
main = 'pack_war.py',
deps = [':util'],
visibility = ['PUBLIC'],
)
python_library(
name = 'util',
srcs = [
'util.py',
'__init__.py'
],
visibility = ['PUBLIC'],
)
python_test(
name = 'util_test',
srcs = ['util_test.py'],
deps = [':util'],
visibility = ['PUBLIC'],
)
def shquote(s):
return s.replace("'", "'\\''")
def os_path():
from os import environ
return environ.get('PATH')
genrule(
name = 'buck.properties',
cmd = 'echo buck=`which buck`>$OUT;' +
("echo PATH=\''%s'\' >>$OUT;" % shquote(os_path())),
deps = [],
out = 'buck.properties',
visibility = ['PUBLIC'],
)