diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-05-26 19:03:40 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-05-26 19:03:40 +0000 |
commit | 295c1e3a4c0a05d30e874beacdf528437098e25d (patch) | |
tree | 0fe0b5fc2e55d422cfa22f19b429724820fdfad0 /tools | |
parent | b9cbde9915eda70a27b105c3117ecaee2b06cd3f (diff) | |
download | classpath-295c1e3a4c0a05d30e874beacdf528437098e25d.tar.gz |
2008-05-26 Andrew John Hughes <gnu_andrew@member.fsf.org>
* tools/gnu/classpath/tools/jar/Creator.java:
(writeCommandLineEntries(Main,OutputStream)):
Add default value for manifest version and
include Created-By property.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gnu/classpath/tools/jar/Creator.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/gnu/classpath/tools/jar/Creator.java b/tools/gnu/classpath/tools/jar/Creator.java index c1660b725..eef31e7e0 100644 --- a/tools/gnu/classpath/tools/jar/Creator.java +++ b/tools/gnu/classpath/tools/jar/Creator.java @@ -50,6 +50,7 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; +import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; @@ -222,9 +223,15 @@ public class Creator throws IOException { manifest = createManifest(parameters); + /* If no version is specified, provide the same manifest version default + * as Sun's jar tool */ + Attributes attr = manifest.getMainAttributes(); + if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null) + attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0"); + attr.putValue("Created-By", System.getProperty("java.version") + + " (" + System.getProperty("java.vendor") + ")"); outputStream = new JarOutputStream(os, manifest); - // FIXME: in Classpath this sets the method too late for the - // manifest file. + // FIXME: this sets the method too late for the manifest file. outputStream.setMethod(parameters.storageMode); writeCommandLineEntries(parameters); } |