During your compilations, you might see warnings like this:
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
To pass the -Xlint:unchecked option to javac within ant, user the compilerarg element like so:
<javac srcdir="${src.dir}"
destdir="${classes.dir}"
classpathref="libraries">
<compilerarg value="-Xlint"/>
</javac>For more granular control over the compiler warning output (-Xlint:unchecked, -Xlint:serial, etc.), see the Non-Standard Options section of the javac man-page. If you want a real-world example, check out the Gagawa build script on Google Code.


Did you find this post helpful, or at least, interesting?