comparison mx/mx_graal.py @ 13347:e3b0608d6ab8

fixed pylint warnings
author Doug Simon <doug.simon@oracle.com>
date Mon, 16 Dec 2013 10:44:34 +0100
parents ecea358f97be
children 16d99e9d77ad
comparison
equal deleted inserted replaced
13346:f17969ae4a35 13347:e3b0608d6ab8
1346 vmArgs, slArgs = _extract_VM_args(args) 1346 vmArgs, slArgs = _extract_VM_args(args)
1347 vm(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl"), "com.oracle.truffle.sl.SimpleLanguage"] + slArgs) 1347 vm(vmArgs + ['-cp', mx.classpath("com.oracle.truffle.sl"), "com.oracle.truffle.sl.SimpleLanguage"] + slArgs)
1348 1348
1349 def trufflejar(args=None): 1349 def trufflejar(args=None):
1350 """make truffle.jar""" 1350 """make truffle.jar"""
1351 1351
1352 # Test with the built classes 1352 # Test with the built classes
1353 _unittest(["com.oracle.truffle.api.test", "com.oracle.truffle.api.dsl.test"], ['@Test', '@LongTest', '@Parameters']) 1353 _unittest(["com.oracle.truffle.api.test", "com.oracle.truffle.api.dsl.test"], ['@Test', '@LongTest', '@Parameters'])
1354 1354
1355 # We use the DSL processor as the starting point for the classpath - this 1355 # We use the DSL processor as the starting point for the classpath - this
1356 # therefore includes the DSL processor, the DSL and the API. 1356 # therefore includes the DSL processor, the DSL and the API.
1357 packagejar(mx.classpath("com.oracle.truffle.dsl.processor").split(os.pathsep), "truffle.jar", None, "com.oracle.truffle.dsl.processor.TruffleProcessor") 1357 packagejar(mx.classpath("com.oracle.truffle.dsl.processor").split(os.pathsep), "truffle.jar", None, "com.oracle.truffle.dsl.processor.TruffleProcessor")
1358 1358
1359 # Test with the JAR 1359 # Test with the JAR
1360 _unittest(["com.oracle.truffle.api.test", "com.oracle.truffle.api.dsl.test"], ['@Test', '@LongTest', '@Parameters'], "truffle.jar:") 1360 _unittest(["com.oracle.truffle.api.test", "com.oracle.truffle.api.dsl.test"], ['@Test', '@LongTest', '@Parameters'], "truffle.jar:")
1361 1361
1362 1362
1363 def isGraalEnabled(vm): 1363 def isGraalEnabled(vm):
1451 _vm_prefix = opts.vm_prefix 1451 _vm_prefix = opts.vm_prefix
1452 1452
1453 mx.distribution('GRAAL').add_update_listener(_installGraalJarInJdks) 1453 mx.distribution('GRAAL').add_update_listener(_installGraalJarInJdks)
1454 1454
1455 def packagejar(classpath, outputFile, mainClass=None, annotationProcessor=None, stripDebug=False): 1455 def packagejar(classpath, outputFile, mainClass=None, annotationProcessor=None, stripDebug=False):
1456 prefix = '' if mx.get_os() != 'windows' else '\\??\\' # long file name hack 1456 prefix = '' if mx.get_os() != 'windows' else '\\??\\' # long file name hack
1457 print "creating", outputFile 1457 print "creating", outputFile
1458 filecount, totalsize = 0, 0 1458 filecount, totalsize = 0, 0
1459 with zipfile.ZipFile(outputFile, 'w', zipfile.ZIP_DEFLATED) as zf: 1459 with zipfile.ZipFile(outputFile, 'w', zipfile.ZIP_DEFLATED) as zf:
1460 manifest = "Manifest-Version: 1.0\n" 1460 manifest = "Manifest-Version: 1.0\n"
1461 if mainClass != None: 1461 if mainClass != None:
1473 zf.writestr(arcname, jar.read(arcname)) 1473 zf.writestr(arcname, jar.read(arcname))
1474 else: 1474 else:
1475 for root, _, files in os.walk(cp): 1475 for root, _, files in os.walk(cp):
1476 for f in files: 1476 for f in files:
1477 fullname = os.path.join(root, f) 1477 fullname = os.path.join(root, f)
1478 arcname = fullname[len(cp)+1:].replace('\\', '/') 1478 arcname = fullname[len(cp) + 1:].replace('\\', '/')
1479 if f.endswith(".class"): 1479 if f.endswith(".class"):
1480 zf.write(prefix + fullname, arcname) 1480 zf.write(prefix + fullname, arcname)
1481 1481
1482 for zi in zf.infolist(): 1482 for zi in zf.infolist():
1483 filecount += 1 1483 filecount += 1