Mercurial > hg > truffle
comparison mx/mx_graal.py @ 13332:ecea358f97be
mx trufflejar: do not strip debug attributes
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Sat, 14 Dec 2013 02:57:09 +0100 |
parents | 093353894575 |
children | e3b0608d6ab8 |
comparison
equal
deleted
inserted
replaced
13331:51b2999299bc | 13332:ecea358f97be |
---|---|
1450 global _vm_prefix | 1450 global _vm_prefix |
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, annotationProcessor=None): | 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" |
1481 | 1481 |
1482 for zi in zf.infolist(): | 1482 for zi in zf.infolist(): |
1483 filecount += 1 | 1483 filecount += 1 |
1484 totalsize += zi.file_size | 1484 totalsize += zi.file_size |
1485 print "%d files (total size: %.2f kB, jar size: %.2f kB)" % (filecount, totalsize / 1e3, os.path.getsize(outputFile) / 1e3) | 1485 print "%d files (total size: %.2f kB, jar size: %.2f kB)" % (filecount, totalsize / 1e3, os.path.getsize(outputFile) / 1e3) |
1486 mx.run([mx.exe_suffix(join(mx.java().jdk, 'bin', 'pack200')), '-r', '-G', outputFile]) | 1486 mx.run([mx.exe_suffix(join(mx.java().jdk, 'bin', 'pack200')), '-r'] + (['-G'] if stripDebug else []) + [outputFile]) |
1487 print "repacked jar size: %.2f kB" % (os.path.getsize(outputFile) / 1e3) | 1487 print "repacked jar size: %.2f kB" % (os.path.getsize(outputFile) / 1e3) |