I have the following in my 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>
This mostly does what I want, except that (as the comment says) I do not want the files in
${src.dir}/com/foo/bar/quux/dontwant/
to be compiled by this task (but I do want everything else under ${src.dir}/com/foo/bar/quux/
to be compiled in this task).
I'm a complete ant n00b, and the documentation hasn't been much help to me. I see several places where it says there are various exclude/excludes elements/attributes, but every variation I can think of either has no effect or results in an error like "blah doesn't support the 'exclude' attribute".