@@ -113,6 +113,12 @@ public class JarLibManifestTask
*/
*/
private String m_implementationURL;
private String m_implementationURL;
/**
* Extra attributes the user specifies for main section
* in manifest.
*/
private final ArrayList m_extraAttributes = new ArrayList();
/**
/**
* Set the name of extension in generated manifest.
* Set the name of extension in generated manifest.
*
*
@@ -213,6 +219,16 @@ public class JarLibManifestTask
m_optionals.addElement( fileSet );
m_optionals.addElement( fileSet );
}
}
/**
* Adds an attribute that is to be put in main section of manifest.
*
* @param attribute an attribute that is to be put in main section of manifest.
*/
public void addAttribute( final ExtraAttribute attribute )
{
m_extraAttributes.add( attribute );
}
public void execute()
public void execute()
throws TaskException
throws TaskException
{
{
@@ -224,6 +240,8 @@ public class JarLibManifestTask
attributes.put( Attributes.Name.MANIFEST_VERSION, MANIFEST_VERSION );
attributes.put( Attributes.Name.MANIFEST_VERSION, MANIFEST_VERSION );
attributes.putValue( "Created-By", Constants.BUILD_DESCRIPTION );
attributes.putValue( "Created-By", Constants.BUILD_DESCRIPTION );
appendExtraAttributes( attributes );
appendExtensionData( attributes );
appendExtensionData( attributes );
final String extensionKey = Extension.EXTENSION_LIST.toString();
final String extensionKey = Extension.EXTENSION_LIST.toString();
@@ -269,6 +287,24 @@ public class JarLibManifestTask
}
}
}
}
/**
* Add any extra attributes to the manifest.
*
* @param attributes the manifest section to write
* attributes to
*/
private void appendExtraAttributes( final Attributes attributes )
{
final Iterator iterator = m_extraAttributes.iterator();
while( iterator.hasNext() )
{
final ExtraAttribute attribute =
(ExtraAttribute)iterator.next();
attributes.putValue( attribute.getName(),
attribute.getValue() );
}
}
/**
/**
* Write out manifest to destfile.
* Write out manifest to destfile.
*
*