Mercurial > hg > graal-jvmci-8
comparison mxtool/mx.py @ 21977:a6425aa8f70c
mx: Add --parsable option to archive
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 15 Jun 2015 11:36:11 +0200 |
parents | 36e37644f91e |
children | c0b6865b7698 |
comparison
equal
deleted
inserted
replaced
21976:36e37644f91e | 21977:a6425aa8f70c |
---|---|
3419 return 0 | 3419 return 0 |
3420 | 3420 |
3421 def archive(args): | 3421 def archive(args): |
3422 """create jar files for projects and distributions""" | 3422 """create jar files for projects and distributions""" |
3423 parser = ArgumentParser(prog='mx archive') | 3423 parser = ArgumentParser(prog='mx archive') |
3424 parser.add_argument('--parsable', action='store_true', dest='parsable', help='Outputs results in a stable parsable way (one archive per line, <ARCHIVE>=<path>)') | |
3424 parser.add_argument('names', nargs=REMAINDER, metavar='[<project>|@<distribution>]...') | 3425 parser.add_argument('names', nargs=REMAINDER, metavar='[<project>|@<distribution>]...') |
3425 args = parser.parse_args(args) | 3426 args = parser.parse_args(args) |
3426 | 3427 |
3427 archives = [] | 3428 archives = [] |
3428 for name in args.names: | 3429 for name in args.names: |
3429 if name.startswith('@'): | 3430 if name.startswith('@'): |
3430 dname = name[1:] | 3431 dname = name[1:] |
3431 d = distribution(dname) | 3432 d = distribution(dname) |
3432 d.make_archive() | 3433 d.make_archive() |
3433 archives.append(d.path) | 3434 archives.append(d.path) |
3435 if args.parsable: | |
3436 log('{0}={1}'.format(dname, d.path)) | |
3434 else: | 3437 else: |
3435 p = project(name) | 3438 p = project(name) |
3436 archives.append(p.make_archive()) | 3439 path = p.make_archive() |
3437 | 3440 archives.append(path) |
3438 logv("generated archives: " + str(archives)) | 3441 if args.parsable: |
3442 log('{0}={1}'.format(name, path)) | |
3443 | |
3444 if not args.parsable: | |
3445 logv("generated archives: " + str(archives)) | |
3439 return archives | 3446 return archives |
3440 | 3447 |
3441 def canonicalizeprojects(args): | 3448 def canonicalizeprojects(args): |
3442 """check all project specifications for canonical dependencies | 3449 """check all project specifications for canonical dependencies |
3443 | 3450 |