From 1eb5ef27e17a00fccbbb580362b75cfad4af10bd Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 12 Dec 2001 11:05:34 +0000 Subject: [PATCH] improve documentation of manifest task, using Conor's patch that caught me mid-flight as a basis. We really should coordinate from time to time 8-) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270132 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/jar.html | 61 +++-------------------------- docs/manual/CoreTasks/manifest.html | 32 ++++++++++++++- 2 files changed, 36 insertions(+), 57 deletions(-) diff --git a/docs/manual/CoreTasks/jar.html b/docs/manual/CoreTasks/jar.html index 8a84baadc..0eab3320a 100644 --- a/docs/manual/CoreTasks/jar.html +++ b/docs/manual/CoreTasks/jar.html @@ -137,21 +137,15 @@ fileset includes a file named MANIFEST.MF, the file is ignored and you will get a warning.

Manifest

+

The manifest nested element allows the manifest for the Jar file to +be provided inline in the build file rather than in an external +file. This element is identical to the +manifest task, but its file and mode +attributes will be ignored.

-The manifest nested element allows the manifest for the Jar file to be -provided inline in the build file rather than in an external file. This -makes it easy to produce Jar manifests which take values from Ant properties. If both an inline manifest and an external file are both specified, the manifests are merged.

-

-The manifest element supports nested elements to reflect the structure of -manifests, according to the -Jar file -specification. Specifically, a manifest -element consists of a set of attributes and sections. These sections in turn -may contain attributes. -

When using inline manifests, the Jar task will check whether the build file is more recent that the Jar file when deciding whether to rebuild the @@ -159,51 +153,6 @@ Jar. This will not take into account property file changes which may affect the resulting Jar.

-

The manifest element itself does not support any attributes. It serves -merely as a container for the attribute and section elements that make up the -manifest. The attributes of those elements are as follows: -

-

-Section -

-

- - - - - - - - - - - -
AttributeDescriptionRequired
NameThe name of the sectionYes
-

- -

-Attribute -

-

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
NameThe name of the attributeYes
ValueThe value of the attributeYes
-

-

Examples

  <jar file="${dist}/lib/app.jar" basedir="${build}/classes"/>

jars all files in the ${build}/classes directory into a file diff --git a/docs/manual/CoreTasks/manifest.html b/docs/manual/CoreTasks/manifest.html index 997ddadfb..92ae24867 100644 --- a/docs/manual/CoreTasks/manifest.html +++ b/docs/manual/CoreTasks/manifest.html @@ -14,6 +14,14 @@

This task can be used to write a Manifest file, optionally replacing or updating an existing file.

+

Manifests are processed according to the +Jar +file specification.. Specifically, a manifest element consists of +a set of attributes and sections. These sections in turn may contain +attributes. Note in particular that this may result in manifest lines +greater than 72 bytes being wrapped and continued on the next +line.

+

Parameters

@@ -28,7 +36,7 @@ replacing or updating an existing file.

- +
modeOne of "update" or "replace", default is "update".One of "update" or "replace", default is "replace". No
@@ -73,6 +81,28 @@ href="#attribute">attribute elements into sections.

to be the main section. + +

Examples

+ +
+  <manifest file="MANIFEST.MF">
+    <attribute name="Built-By" value="${user.name}"/>
+    <section name="common/class1.class">
+      <attribute name="Sealed" value="false"/>
+    </section>
+  </manifest>
+
+ +

Creates or replaces the file MANIFEST.MF. Note that the Built-By +attribute will take the value of the Ant property ${user.name}. The +manifest produced by the above would look like this: +

+
Manifest-Version: 1.0
+Built-By: bodewig
+Created-By: Apache Ant 1.5alpha
+
+Name: common/class1.class
+Sealed: false