# HG changeset patch # User Bernhard Urban # Date 1400678978 -7200 # Node ID f0127716b881c99f4264e92dc2777551bd5958f4 # Parent 2460aed6c899bc5f4409d85c4fa11329141b6264 mx: remove unused packagejar command diff -r 2460aed6c899 -r f0127716b881 mx/mx_graal.py --- a/mx/mx_graal.py Wed May 21 15:11:14 2014 +0200 +++ b/mx/mx_graal.py Wed May 21 15:29:38 2014 +0200 @@ -2093,37 +2093,3 @@ _vm_prefix = opts.vm_prefix mx.distribution('GRAAL').add_update_listener(_installGraalJarInJdks) - -def packagejar(classpath, outputFile, mainClass=None, annotationProcessor=None, stripDebug=False): - prefix = '' if mx.get_os() != 'windows' else '\\??\\' # long file name hack - print "creating", outputFile - filecount, totalsize = 0, 0 - with zipfile.ZipFile(outputFile, 'w', zipfile.ZIP_DEFLATED) as zf: - manifest = "Manifest-Version: 1.0\n" - if mainClass != None: - manifest += "Main-Class: %s\n\n" % (mainClass) - zf.writestr("META-INF/MANIFEST.MF", manifest) - if annotationProcessor != None: - zf.writestr("META-INF/services/javax.annotation.processing.Processor", annotationProcessor) - for cp in classpath: - print "+", cp - if cp.endswith(".jar"): - with zipfile.ZipFile(cp, 'r') as jar: - for arcname in jar.namelist(): - if arcname.endswith('/') or arcname == 'META-INF/MANIFEST.MF' or arcname.endswith('.java') or arcname.lower().startswith("license") or arcname in [".project", ".classpath"]: - continue - zf.writestr(arcname, jar.read(arcname)) - else: - for root, _, files in os.walk(cp): - for f in files: - fullname = os.path.join(root, f) - arcname = fullname[len(cp) + 1:].replace('\\', '/') - if f.endswith(".class"): - zf.write(prefix + fullname, arcname) - - for zi in zf.infolist(): - filecount += 1 - totalsize += zi.file_size - print "%d files (total size: %.2f kB, jar size: %.2f kB)" % (filecount, totalsize / 1e3, os.path.getsize(outputFile) / 1e3) - mx.run([mx.exe_suffix(join(mx.java().jdk, 'bin', 'pack200')), '-r'] + (['-G'] if stripDebug else []) + [outputFile]) - print "repacked jar size: %.2f kB" % (os.path.getsize(outputFile) / 1e3)