Shawn Pearce | fd6bb9f | 2013-05-08 14:14:24 -0700 | [diff] [blame] | 1 | BASE = get_base_path() |
| 2 | CORE = [ |
| 3 | 'commit-message-length-validator', |
Edwin Kempin | 7bfe168 | 2013-10-16 12:57:16 +0200 | [diff] [blame] | 4 | 'download-commands', |
Shawn Pearce | fd6bb9f | 2013-05-08 14:14:24 -0700 | [diff] [blame] | 5 | 'replication', |
| 6 | 'reviewnotes', |
David Pursehouse | 5788a51 | 2014-04-17 22:19:07 +0900 | [diff] [blame] | 7 | 'singleusergroup' |
Shawn Pearce | fd6bb9f | 2013-05-08 14:14:24 -0700 | [diff] [blame] | 8 | ] |
| 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 |
| 14 | def 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 |
| 23 | HAVE, NEED = filter(CORE) |
| 24 | |
| 25 | genrule( |
| 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 Pearce | a0c9372 | 2013-05-10 11:20:55 -0700 | [diff] [blame] | 30 | 'mkdir -p $TMP/WEB-INF/plugins;' + |
David Ostrovsky | d8af092 | 2014-05-30 12:42:32 +0200 | [diff] [blame] | 31 | '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 Pearce | a0c9372 | 2013-05-10 11:20:55 -0700 | [diff] [blame] | 34 | 'cd $TMP;' + |
Shawn Pearce | fd6bb9f | 2013-05-08 14:14:24 -0700 | [diff] [blame] | 35 | 'zip -qr $OUT .', |
Shawn Pearce | fd6bb9f | 2013-05-08 14:14:24 -0700 | [diff] [blame] | 36 | out = 'core.zip', |
| 37 | visibility = ['//:release'], |
| 38 | ) |