blob: 134f2753efec5897d432c69e51bf6f0e99a76066 [file] [log] [blame]
Shawn Pearcefd6bb9f2013-05-08 14:14:24 -07001BASE = get_base_path()
2CORE = [
3 'commit-message-length-validator',
Edwin Kempin7bfe1682013-10-16 12:57:16 +02004 'download-commands',
Shawn Pearcefd6bb9f2013-05-08 14:14:24 -07005 'replication',
6 'reviewnotes',
David Pursehouse5788a512014-04-17 22:19:07 +09007 'singleusergroup'
Shawn Pearcefd6bb9f2013-05-08 14:14:24 -07008]
9
10# buck audit parses and resolves all deps even if not reachable
11# from the root(s) passed to audit. Filter dependencies to only
12# the ones that currently exist to allow buck to parse cleanly.
13# TODO(sop): buck should more lazily resolve deps
14def filter(names):
15 from os import path
16 h, n = [], []
17 for p in names:
18 if path.exists(path.join(BASE, p, 'BUCK')):
19 h.append(p)
20 else:
21 n.append(p)
22 return h, n
23HAVE, NEED = filter(CORE)
24
25genrule(
26 name = 'core',
27 cmd = '' +
28 ';'.join(['echo >&2 plugins/'+n+' is required.' for n in NEED]) +
29 (';echo >&2;exit 1;' if NEED else '') +
Shawn Pearcea0c93722013-05-10 11:20:55 -070030 'mkdir -p $TMP/WEB-INF/plugins;' +
David Ostrovskyd8af0922014-05-30 12:42:32 +020031 'for s in ' +
32 ' '.join(['$(location //%s/%s:%s)' % (BASE, n, n) for n in HAVE]) +
33 ';do ln -s $s $TMP/WEB-INF/plugins;done;' +
Shawn Pearcea0c93722013-05-10 11:20:55 -070034 'cd $TMP;' +
Shawn Pearcefd6bb9f2013-05-08 14:14:24 -070035 'zip -qr $OUT .',
Shawn Pearcefd6bb9f2013-05-08 14:14:24 -070036 out = 'core.zip',
37 visibility = ['//:release'],
38)