为什么蚂蚁编译每个运行的所有类? [英] Why does ant compile all classes each run?
问题描述
我更习惯于做,所以我很困惑,为什么当源没有改变蚂蚁重新编译的类。我读过,有在某些情况下使用泛型重新编译的要求,但我不知道这将是必要的我的项目。
此外,在javac任务,我给自己定includeDestClasses =真正的
下面是一些我使用的目标
<目标名称=初始化>
< MKDIR DIR =$ {}构建/>
< MKDIR DIR =$ {} DIST/>
< /目标与GT;
<目标名称=编译取决于=的init,UTIL,语义学描述=/>
<目标名称=UTIL取决于=说明=>
< javac的DESTDIR =$ {}构建CLASSPATH =project.class.path调试=关于SRCDIR =$ {}的src / UTILincludeDestClasses =真实来源=1.5>
<类路径REFID =project.class.path/>
< / javac的>
< /目标与GT;
尝试修改的javac
任务的开始标记包括一个 SRCDIR
属性和包括
属性:
< javac的DESTDIR =$ {}构建CLASSPATH =project.class.path调试=关于SRCDIR =$ {src}字符串包括=UTIL / **includeDestClasses =真实来源=1.5 >
I'm more accustomed to make, so I'm confused why ant recompiles classes when the source hasn't been changed. I've read that there is a requirement to recompile in some cases where generics are used, but I'm not sure that this will be necessary for my project.
Also, in the javac task, I've set includeDestClasses="true"
Here's some of the targets I'm using
<target name="init">
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target>
<target name="compile" depends="init,util,semantics" description=""/>
<target name="util" depends="" description="">
<javac destdir="${build}" classpath="project.class.path" debug="on" srcdir="${src}/util" includeDestClasses="true" source="1.5">
<classpath refid="project.class.path"/>
</javac>
</target>
Try modifying the opening tag of the javac
task to include both a srcdir
attribute and an includes
attribute:
<javac destdir="${build}" classpath="project.class.path" debug="on" srcdir="${src}" includes="util/**" includeDestClasses="true" source="1.5">
这篇关于为什么蚂蚁编译每个运行的所有类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!