首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在ant中排除javac任务中的源代码?

如何在ant中排除javac任务中的源代码?
EN

Stack Overflow用户
提问于 2010-06-30 09:44:28
回答 5查看 33.4K关注 0票数 17

我的build.xml中有以下内容:

<target name="compile.baz" depends="init">
   <javac destdir="${build.dir}/classes" debug="on">
      <compilerarg value="-Xlint:deprecation"/>
      <src>
         <pathelement location="${src.dir}/com/foo/bar/baz/" />
         <pathelement location="${src.dir}/com/foo/bar/quux/" />
         <!-- Need to exclude ${src.dir}/com/foo/bar/quux/dontwant/ -->
      </src>
      <classpath refid="classpath.jars" />
   </javac>
   ...
</target>

这基本上就是我想要的,除了(正如评论所说的)我不想把文件放在

此任务将编译${src.dir}/com/foo/bar/quux/dontwant/ (但我确实希望在此任务中编译${src.dir}/com/foo/bar/quux/下的所有其他内容)。

我看到有几个地方说有各种各样的exclude/excludes元素/属性,但我能想到的每一种变化要么没有效果,要么导致错误,比如"blah不支持'exclude‘属性“。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3145968

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档