Here is it sent again, w/ versioning.html converted to versioning.html.txt.

regards

Adam
-----Original Message-----
From: ajack [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 31, 2002 6:49 PM
To: 'Jakarta General List'
Subject: RE: Managing versions of Apache Jakarta software


Danny Angus wrote:

        Perhaps if you were to submit an idea for a simple manual/ant automated
        process someone might add it to the website for further discussion.. I
        believe someone was looking at writing  guidlines for release managment but
        don't know what happened there. That might be a suitable place for it.

How about  this: versioning.html -- with a couple of add ons: build.xml and
manifest.template.

regards

Adam
<?xml version="1.0"?>

<project name="manifest" default="manifest" basedir=".">

	<property name="version" 	value="1-1-1" 	/>

  	<target name="manifest">
		<filter token="version" value="${version}" /> 
		<copy 	file="manifest.template" 
			tofile="manifest.mf" 
			overwrite="true"
			filtering="true" /> 
  	</target>


	
</project>

Attachment: manifest.template
Description: Binary data

<HTML>
<TITLE>JAR/Package Versioning</TITLE>
<BODY>
<H3>Package Versioning</H3>
<P>
The <A TARGET="_new" 
HREF='http://java.sun.com/j2se/1.4/docs/guide/versioning/spec/VersioningSpecification.html'>Java&trade;
 Product Versioning Specification</A> allows users to identify the exact version 
information of a package within a JAR. This is particularly useful when users have a 
number of packages, with version interdependences, from various distributions. 
</P>
<P>
These four simple steps use ANT to maintain and insert the versioning information, so 
all JARs shipped are correctly versioned. <B>Note:</B> This is just one method, and in 
future releases ANT may have built in mechanisms for this task.
</P>
<H3>Step 1: Manually create a template manifest file.</H3>
<P>Java versioning is implemented by attributes set within the manifest of the JAR.</P>
<P>
See Javasoft's documentation on: <A TARGET="_new" 
HREF='http://java.sun.com/j2se/1.4/docs/guide/versioning/spec/VersioningSpecification.html#JARManifestFormat'>JAR
 Manifest Format</A>
</P>
<P>
<TABLE BORDER=1 ALIGN=CENTER>
<TR><TD><PRE>
Manifest-version: 1.0

Name: org/apache/{Apache Package}/
Implementation-Title: {Apache Package}
Implementation-Version: @version@
Implementation-Vendor: "Apache Software Foundation"
</PRE>
</TD></TR>
</TABLE>
</P>
<P>
Save this with your build.xml as a file called <B>manifest.template</B>.
</P>
<P>
<B>Note:</B>&nbsp;The <EM>{Apacke Package}</EM> ought be manually replaced by the 
package name, e.g. "log4j" or "Axis"<BR>
<B>Note:</B>&nbsp;The <EM>@version@</EM> is a specific keyword used later in ANT 
filtering, and will be dynamically updated.
</P>
<H3>Step 2: Maintain the version in your ANT build script</H3>
<P>
Set and maintain the <B>${version}</B> property.
</P>
<P>
<TABLE BORDER=1 ALIGN=CENTER>
<TR><TD><PRE>&lt;property name=&quot;version&quot; value=&quot;1-1-1&quot; 
/&gt;</PRE></TD></TR>
</TABLE>
</P>
<H3>Step 3: Create the manifest, filtering the version</H3>
<P>
This replaces <B>@version@</B> in <RM>manifest.template</EM> with <B>1-1-1</B> in 
<EM>manifest.mf</EM>.
</P>
<P>
<TABLE BORDER=1 ALIGN=CENTER>
<TR><TD><PRE>
&lt;target name=&quot;manifest&quot;&gt;
        &lt;filter token=&quot;version&quot; value=&quot;${version}&quot; /&gt; 
        &lt;copy        file=&quot;manifest.template&quot;
                tofile=&quot;manifest.mf&quot; 
                overwrite=&quot;true&quot;
                filtering=&quot;true&quot; /&gt; 
&lt;/target&gt;</PRE></TD></TR>
</TABLE>
</P>
<H3>Step 4: Create your JAR, setting the manifest attribute</H3>
<P>
This sets the <B>META-INF/Manifest.mf</B> in the JAR file.
</P>
<P>
<TABLE BORDER=1 ALIGN=CENTER>
<TR><TD><PRE>
&lt;target name="distribution" depends="<EM>...</EM> manifest <EM>...</EM>">
        &lt;jar jarfile=<EM>...</EM>
                        <B>manifest=&quot;manifest.mf&quot;</B>/&gt;
</PRE>
</TD></TR>
</TABLE>
</P>
<HR WIDTH=100%>
<P>
Sample Files:   <A HREF="manifest.template">manifest.template</A>, <A 
HREF="build.xml">build.xml</A>
</P>
</BODY>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to