gerrit/plugins/BUCK
David Pursehouse cad96d6462 Move hooks from core Gerrit to 'hooks' plugin
Change-Id: If45b32ffb0e9f52677886103212563d8af6c6099
2016-07-04 11:06:18 +09:00

43 lines
1.1 KiB
Python

BASE = get_base_path()
CORE = [
'commit-message-length-validator',
'download-commands',
'hooks',
'replication',
'reviewnotes',
'singleusergroup'
]
CUSTOM = [
# Add custom core plugins here
]
# 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 core_plugins(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 = core_plugins(CORE + CUSTOM)
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 ' +
' '.join(['$(location //%s/%s:%s)' % (BASE, n, n) for n in HAVE]) +
';do ln -s $s $TMP/WEB-INF/plugins;done;' +
'cd $TMP;' +
'zip -qr $OUT .',
out = 'core.zip',
visibility = ['//:release'],
)