Ant入门使用
1. <project name="MyProject" default="dist" basedir="."> 2. <property name="src" value="."/> 3. <property name="build" value="build"/> 4. <property name="dist" value="dist"/> 5. <property name="class.dir" value="lib"/> 6. <!--设置编绎路径--> 7. <path id="classpath"> 8. <pathelement location="${classpath.dir}"/> 9. <fileset dir="${classpath.dir}" includes="**/*.jar"/> 10. </classpath> 11. 12. <!--创建文件--> 13. <target name="init"> 14. <mkdir dir="${build}"/> 15. </target> 16. 17. <!--表示compile依赖init,编绎java文件--> 18. <target name="compile" depends="init"> 19. <javac srcdir="${src}" destdir="${build}"> 20. <classpath refif="classpath"> 21. </javac> 22. </target> 23. 24. <!--打jar架包--> 25. <target name="dist" depends="compile"> 26. <mkdir dir="${dist}/lib"/> 27. <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar"/> 28. </target> 29. 30. <!--- 删除文件夹-> 31. <target name="clean"> 32. <delete dir="${build}"/> 33. <delete dir="${dist}"/> 34. </target> 35. 36. </project>
相关推荐
BitsPlayer 2020-05-29
roygbip 2020-02-16
BitsPlayer 2020-02-13
lrcoop 2020-02-03
chichichi0 2020-01-06
BitsPlayer 2019-12-19
BitsPlayer 2019-12-14
xueliangEmail 2013-07-22
cailianren 2010-04-15
wugang0 2019-11-09
lustdevil 2011-08-28
evilvoid 2008-04-17
leonranri 2019-11-05
leeccr 2019-10-31
evilvoid 2010-02-02