我想用ant javac编译我的项目,关于我的一些java文件有错误,我不想编译它们,我必须覆盖ant "-compile"
任务并添加{{1}为了从编译中忽略这个文件,但在控制台中我仍然看到编译器想要编译这个文件,它在这个文件中显示一些错误。
解决方案是什么?
excludes="**/Global.java"
文件路径:<target name="-compile" depends="-pre-build, -build-setup, -code-gen, -pre-compile">
<do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
<!-- merge the project's own classpath and the tested project's classpath -->
<path id="project.javac.classpath">
<path refid="project.all.jars.path" />
<path refid="tested.project.classpath" />
<path path="${java.compiler.classpath}" />
</path>
<javac encoding="${java.encoding}"
source="${java.source}" target="${java.target}"
debug="true" extdirs=""
includeantruntime="false"
excludes="**/Global.java"
destdir="${out.classes.absolute.dir}"
bootclasspathref="project.target.class.path"
verbose="${verbose}"
classpathref="project.javac.classpath"
fork="${need.javac.fork}">
<src path="${source.absolute.dir}" />
<src path="${gen.absolute.dir}" />
<compilerarg line="${java.compilerargs}" />
</javac>
</do-only-if-manifest-hasCode>
</target>