Hi, all.

If the property "manifest.main-class" is set, I want my jar to have 
that class specified in the Main-Class section of its manifest. 
Otherwise, I want it to just have the usual default manifest built.

Currently, my jar is build via:
   <target name="dist-debug" depends="compile-debug" 
description="Build debug jar">
     <jar
       jarfile="${dist}/${baseJarName}-${DSTAMP}-debug.jar"
       basedir="${build-debug}"
     />
   </target>

I believe the following will work to create the manifest if I always 
know that the property manifest.main.class is set

   <property name="manifest.file" value="manifest.mf"/>
   <property name="manifest.main.class" value="org.foo.dosomething"/>

   <target name="dist-debug-manifest" depends="compile-debug" 
description="Build debug jar with manifest">
     <jar
       jarfile="${dist}/${baseJarName}-${DSTAMP}-debug.jar"
       basedir="${build-debug}">
       <manifest>
         <attribute name="Main-Class" value="${manifest.main-class}"/>
       </manifest>
     </jar>
   </target>

I am not sure how to have the <manifest> section only happen if there 
is actually a manifest.

Does anyone else create a manifest on the fly this way?

Scott
-- 

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

Reply via email to