开发者

How to Setup an ANT file to create a JAVA JAR that is containing/packaging this calculator?

I already made a running program whi开发者_如何学运维ch is calculator in IntelliJ IDEA and make a test and it goes fine. My problem is that how to setup an ANT file to create a JAVA JAR that is calculator.

Hoping for your answers..

tnx.


This is an example of an ant target that does jar creation.

<!-- roll up everyting into a single jar file -->
<target name="dist" depends="clean, compile" description="Generate the distribution file.">
<!--
Copy the library .jars to the directory where the distribution will be located
-->
<copy todir="${dist}">
<fileset dir="${lib}"/>
</copy>
<!-- TODO: Generate the MANIFEST.MF file on the fly -->
<jar jarfile="${dist}/myCalculator.jar" basedir="${build}" manifest="tools/MANIFEST.MF"/>
<!-- dump to web server -->
<copy todir="${web-files}">
<fileset dir="${dist}"/>
</copy>
</target>


Take a look at the Ant manual page for the Jar task. There are lots of examples there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜