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