ant complie jar – JAVA編程語言程序開發技術文章

1. <?xml version="1.0" encoding="GB2312"?>
2. <project default="jar" basedir=".">
3.     <property name="complie" value="complie"></property>
4.     <property name="dist" value="dist"></property>
5.     <target name="mk">
6.         <mkdir dir="${complie}"/>
7.         <mkdir dir="${dist}"/>
8.     </target>
9. 
10. 
11.     <target name="myComplie" depends="mk">
12.         <javac srcdir="src" destdir="${complie}" debug="true"></javac>
13.     </target>
14.     <target name="jar" depends="myComplie">
15.         <jar destfile="${dist}/user.jar" basedir="${complie}">
16.             <manifest>
17.                 <attribute name="Built-By" value="${user.name}"/>
18.                 <attribute name="Main-Class" value="cn.lxl.innerclass.test3"/>
19.             </manifest>
20.         </jar>
21.     </target>
22. </project>
 
本文出自 “Jxiaolei” 博客

發佈留言