在《Ant与批处理(win环境)学习笔记》中学习了Ant的一些基础知识,这期继续深入学习
——————————Ant常用task————————————————————————
1、使用classPath
2、设置classpath
3、 输出信息
输出文本信息使用echo; 输出xml使用echoxml; 引入文件使用import
4、 拷贝文件
<copy file="myfile.txt" tofile="yourfile.txt"/>
copy的属性有:
file、 dir、fileset等;
copydir:拷贝目录
5、 删除文件
<delete file="xxx"/>
delete属性有file、dir
deletetree:删除文件目录树
——————————Ant常用task————————————————————————
1、使用classPath
<target>
<javac>
<classpath refid="project.class.path"/>
</javac>
</target>
2、设置classpath
<classpath id="project.class.path">
<pathelement path="${classpath}"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="classes"/>
<dirset dir="build">
<include name="apps/**/classes"/>
<exclude name="apps/**/*Test*"/>
</dirset>
<filelist refid="xxx"/>
</classpath>
3、 输出信息
输出文本信息使用echo; 输出xml使用echoxml; 引入文件使用import
4、 拷贝文件
<copy file="myfile.txt" tofile="yourfile.txt"/>
copy的属性有:
file、 dir、fileset等;
copydir:拷贝目录
5、 删除文件
<delete file="xxx"/>
delete属性有file、dir
deletetree:删除文件目录树