Mike, another way to to tell javac to explicitly not access certain files is to unset sourcepath. I just figured this out...
From the Ant manual:
Note: If you wish to compile only source files located in certain
packages below a common root, use the include/exclude attributes or
/ nested elements to filter for these packages. Do
not include part of your package structure in the srcdir attribute (or
nested elements), or Ant will recompile your source files every
time you run your compile target. See the Ant FAQ for additional
information.
If you wish to compile only files explicitly specified and disable
javac's default searching mechanism then you can unset the sourcepath
attribute:
<javac sourcepath="" srcdir="${src}" destdir="${build}" >
<include name="**/*.java"/>
<exclude name="**/Example.java"/>
</javac>
That way the javac will compile all java source files under "${src}"
directory but skip the examples. The compiler will even produce errors
if some of the non-example files refers to them.