Browse Source

Make Create-By attribute in manifest compliant with spec by listing

the java implementation version and vendor. Add an Ant-Version field to
show the Ant version

PR:	12219


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273926 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 22 years ago
parent
commit
82d37706ea
2 changed files with 9 additions and 3 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/defaultManifest.mf
  2. +8
    -2
      src/main/org/apache/tools/ant/taskdefs/Manifest.java

+ 1
- 1
src/main/org/apache/tools/ant/defaultManifest.mf View File

@@ -1,3 +1,3 @@
Manifest-Version: 1.0
Created-By: Apache Ant @VERSION@
Ant-Version: Apache Ant @VERSION@


+ 8
- 2
src/main/org/apache/tools/ant/taskdefs/Manifest.java View File

@@ -1,7 +1,7 @@
/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2002 The Apache Software Foundation. All rights
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -729,7 +729,13 @@ public class Manifest {
+ defManifest);
}
try {
return new Manifest(new InputStreamReader(in, "ASCII"));
Manifest defaultManifest
= new Manifest(new InputStreamReader(in, "ASCII"));
Attribute createdBy = new Attribute("Created-By",
System.getProperty("java.vm.version") + " ("
+ System.getProperty("java.vm.vendor") + ")" );
defaultManifest.getMainSection().storeAttribute(createdBy);
return defaultManifest;
} catch (UnsupportedEncodingException e) {
return new Manifest(new InputStreamReader(in));
}


Loading…
Cancel
Save