所以我使用ant并且我正在编译并正常运行但我希望在完成输出后删除所有.class文件。我以为我是以正确的方式做到这一点,但显然我不是。
这是我的代码:
<project default="run">
<description>
Compile/run all the files
</description>
<presetdef name="javac">
<javac includeantruntime="false" />
</presetdef>
<target name="prob1" depends='compile'>
<java classname='prob1'>
<classpath path='./' />
<arg value='Gertrude' />
</java>
</target>
<target name="prob2" depends='compile'>
<java classname='prob2'>
<classpath path='./' />
<arg value='28' />
</java>
</target>
<target name="prob3" depends='compile'>
<java classname='prob3'>
<classpath path='./' />
<arg value='2001' />
</java>
</target>
<target name="prob4" depends='compile'>
<java classname='prob4'>
<classpath path='./' />
<arg value='3' />
</java>
</target>
<target name="compile">
<javac srcdir='./' />
</target>
<target name="clean">
<delete>
<fileset dir="." includes="*.class"/>
</delete>
</target>
</project>