Mercurial > hg > truffle
comparison mx/commands.py @ 4226:e03ff10d4bfc
Made the gate clean the Java projects only.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 05 Jan 2012 13:17:15 +0100 |
parents | 339cf8d4904d |
children | 1fe200db8c30 |
comparison
equal
deleted
inserted
replaced
4225:339cf8d4904d | 4226:e03ff10d4bfc |
---|---|
38 _winSDK = 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\' | 38 _winSDK = 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\' |
39 _mksHome = 'C:\\cygwin\\bin' | 39 _mksHome = 'C:\\cygwin\\bin' |
40 | 40 |
41 def clean(args): | 41 def clean(args): |
42 """cleans the GraalVM source tree""" | 42 """cleans the GraalVM source tree""" |
43 mx.clean(args) | 43 opts = mx.clean(args) |
44 os.environ.update(ARCH_DATA_MODEL='64', LANG='C', HOTSPOT_BUILD_JOBS='16') | 44 if opts.native: |
45 mx.run([mx.gmake_cmd(), 'clean'], cwd=join(_graal_home, 'make')) | 45 os.environ.update(ARCH_DATA_MODEL='64', LANG='C', HOTSPOT_BUILD_JOBS='16') |
46 mx.run([mx.gmake_cmd(), 'clean'], cwd=join(_graal_home, 'make')) | |
46 | 47 |
47 def copyrightcheck(args): | 48 def copyrightcheck(args): |
48 """run copyright check on the Mercurial controlled source files""" | 49 """run copyright check on the Mercurial controlled source files""" |
49 res = mx.run_java(['-cp', mx.classpath('com.oracle.max.base', resolve=False), 'com.sun.max.tools.CheckCopyright', '-cfp=' + join(mx.project('com.oracle.max.base').dir, '.copyright.regex')] + args) | 50 res = mx.run_java(['-cp', mx.classpath('com.oracle.max.base', resolve=False), 'com.sun.max.tools.CheckCopyright', '-cfp=' + join(mx.project('com.oracle.max.base').dir, '.copyright.regex')] + args) |
50 mx.log("copyright check result = " + str(res)) | 51 mx.log("copyright check result = " + str(res)) |
268 return ret | 269 return ret |
269 | 270 |
270 def build(args): | 271 def build(args): |
271 """builds the GraalVM binary and compiles the Graal classes | 272 """builds the GraalVM binary and compiles the Graal classes |
272 | 273 |
273 The optional argument specifies what type of VM to build.""" | 274 The optional last argument specifies what type of VM to build.""" |
274 | 275 |
275 build = 'product' | 276 build = 'product' |
276 if len(args) != 0 and not args[0].startswith('-'): | 277 if len(args) != 0 and not args[0].startswith('-'): |
277 build = args.pop(0) | 278 build = args.pop(0) |
278 | 279 |
279 # Call mx.build to compile the Java sources | 280 # Call mx.build to compile the Java sources |
280 mx.build(args + ['--source', '1.7']) | 281 opts = mx.build(args + ['--source', '1.7']) |
281 | 282 |
282 if not _vmSourcesAvailable: | 283 if not _vmSourcesAvailable or not opts.native: |
283 return | 284 return |
284 | 285 |
285 jdk = _jdk(build, True) | 286 jdk = _jdk(build, True) |
286 if build == 'debug': | 287 if build == 'debug': |
287 build = 'jvmg' | 288 build = 'jvmg' |
519 If this commands exits with a 0 exit code, then the source code is in | 520 If this commands exits with a 0 exit code, then the source code is in |
520 a state that would be accepted for integration into the main repository.""" | 521 a state that would be accepted for integration into the main repository.""" |
521 | 522 |
522 start = time.time() | 523 start = time.time() |
523 | 524 |
524 # 1. Clean | 525 # 1. Clean (cleaning of native code disabled as gate machine takes too long to do a clean HotSpot build) |
525 # clean([]) | 526 clean(['--no-native']) |
526 | 527 |
527 # 2. Checkstyle | 528 # 2. Checkstyle |
528 mx.log(time.strftime('%d %b %Y %H:%M:%S - Running Checkstyle...')) | 529 mx.log(time.strftime('%d %b %Y %H:%M:%S - Running Checkstyle...')) |
529 if mx.checkstyle([]) != 0: | 530 if mx.checkstyle([]) != 0: |
530 mx.abort('Checkstyle warnings were found') | 531 mx.abort('Checkstyle warnings were found') |
583 print results | 584 print results |
584 | 585 |
585 def mx_init(): | 586 def mx_init(): |
586 _vmbuild = 'product' | 587 _vmbuild = 'product' |
587 commands = { | 588 commands = { |
588 'build': [build, ''], | 589 'build': [build, '[-options]'], |
589 'clean': [clean, ''], | 590 'clean': [clean, ''], |
590 'copyrightcheck': [copyrightcheck, ''], | 591 'copyrightcheck': [copyrightcheck, ''], |
591 'dacapo': [dacapo, '[benchmark] [VM options|DaCapo options]'], | 592 'dacapo': [dacapo, '[benchmark] [VM options|DaCapo options]'], |
592 'example': [example, '[-v] example names...'], | 593 'example': [example, '[-v] example names...'], |
593 'gate' : [gate, ''], | 594 'gate' : [gate, ''], |
603 mx.add_argument('--fastdebug', action='store_const', dest='vmbuild', const='fastdebug', help='select the fast debug VM') | 604 mx.add_argument('--fastdebug', action='store_const', dest='vmbuild', const='fastdebug', help='select the fast debug VM') |
604 mx.add_argument('--optimized', action='store_const', dest='vmbuild', const='optimized', help='select the optimized VM') | 605 mx.add_argument('--optimized', action='store_const', dest='vmbuild', const='optimized', help='select the optimized VM') |
605 | 606 |
606 commands.update({ | 607 commands.update({ |
607 'export': [export, '[-options] [zipfile]'], | 608 'export': [export, '[-options] [zipfile]'], |
608 'build': [build, '[product|debug|fastdebug|optimized]'] | 609 'build': [build, '[-options] [product|debug|fastdebug|optimized]'] |
609 }) | 610 }) |
610 | 611 |
611 mx.commands.update(commands) | 612 mx.commands.update(commands) |
612 | 613 |
613 def mx_post_parse_cmd_line(opts): | 614 def mx_post_parse_cmd_line(opts): |