blob: 16c65dab0f0e49505813e9f6ca2982be99463e6b [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',
7]
8
9# buck audit parses and resolves all deps even if not reachable
10# from the root(s) passed to audit. Filter dependencies to only
11# the ones that currently exist to allow buck to parse cleanly.
12# TODO(sop): buck should more lazily resolve deps
13def filter(names):
14 from os import path
15 h, n = [], []
16 for p in names:
17 if path.exists(path.join(BASE, p, 'BUCK')):
18 h.append(p)
19 else:
20 n.append(p)
21 return h, n
22HAVE, NEED = filter(CORE)
23
24genrule(
25 name = 'core',
26 cmd = '' +
27 ';'.join(['echo >&2 plugins/'+n+' is required.' for n in NEED]) +
28 (';echo >&2;exit 1;' if NEED else '') +
Shawn Pearcea0c93722013-05-10 11:20:55 -070029 'mkdir -p $TMP/WEB-INF/plugins;' +
Shawn Pearcefd6bb9f2013-05-08 14:14:24 -070030 'for s in $SRCS;do ln -s $s $TMP/WEB-INF/plugins;done;' +
Shawn Pearcea0c93722013-05-10 11:20:55 -070031 'cd $TMP;' +
Shawn Pearcefd6bb9f2013-05-08 14:14:24 -070032 'zip -qr $OUT .',
David Pursehouse7fcd2022013-12-16 16:22:28 +090033 srcs = [genfile('%s/%s.jar' % (n, n)) for n in HAVE],
Shawn Pearcefd6bb9f2013-05-08 14:14:24 -070034 deps = ['//%s/%s:%s' % (BASE, n, n) for n in HAVE],
35 out = 'core.zip',
36 visibility = ['//:release'],
37)