gerrit/plugins/BUCK
David Pursehouse 5788a5143d Make singleusergroup a core plugin
This plugin might be useful for a lot of users.  Make it a core plugin
so it gets included in the distributed war file and offered to the user
during installation.

Change-Id: Ic69e01018d11b1989b36150584b104a98d48ea99
2014-04-17 22:19:07 +09:00

39 lines
1.0 KiB
Python

BASE = get_base_path()
CORE = [
'commit-message-length-validator',
'download-commands',
'replication',
'reviewnotes',
'singleusergroup'
]
# buck audit parses and resolves all deps even if not reachable
# from the root(s) passed to audit. Filter dependencies to only
# the ones that currently exist to allow buck to parse cleanly.
# TODO(sop): buck should more lazily resolve deps
def filter(names):
from os import path
h, n = [], []
for p in names:
if path.exists(path.join(BASE, p, 'BUCK')):
h.append(p)
else:
n.append(p)
return h, n
HAVE, NEED = filter(CORE)
genrule(
name = 'core',
cmd = '' +
';'.join(['echo >&2 plugins/'+n+' is required.' for n in NEED]) +
(';echo >&2;exit 1;' if NEED else '') +
'mkdir -p $TMP/WEB-INF/plugins;' +
'for s in $SRCS;do ln -s $s $TMP/WEB-INF/plugins;done;' +
'cd $TMP;' +
'zip -qr $OUT .',
srcs = [genfile('%s/%s.jar' % (n, n)) for n in HAVE],
deps = ['//%s/%s:%s' % (BASE, n, n) for n in HAVE],
out = 'core.zip',
visibility = ['//:release'],
)