ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: jar ant task
Date Tue, 26 Oct 2010 16:05:32 GMT
2010/10/25 codecook <codecook@163.com>:
> OK,I have found a solution,sample file likes this :
> <jar destfile="${destJarPackage}" manifest="${buildDir}\META-INF\MANIFEST.MF">
> <fileset dir="${buildDir}"></fileset>
> </jar>

Is this a solution to your problem?

You can also use the <manifest> subtask to build the manifest for you.

<jar destfile="${destJarFile}"
    <fileset dir="${build.dir}"/>
    <manifest>
       <attribute name="Release" value="${revision}"/>
       <attribute name="copyright" value="2010"/>
       <section name="Company Info">
          <attribute name="Company Name" value="${company}"/>
          <attribute name="License" value="${licenseURL}"/>
       </section>
     </manifest>
</jar>

I find using the Manifest subtask a bit easier to maintain. People
sometimes forget about the Manifest file and the information in there
gets out of date. With the Manifest in the build.xml, it's easier to
see and more likely to be updated. Plus, you can calculate many of the
values dynamically (like keeping the copyright date up to date).

-- 
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message