I am trying to write ant build for compiling source folder here is my script target for compiling.
So if you are not deleting the classes directory in any dependent task say 'clean' the javac task inherently compiles only the changed java files. It is an out of the box feature that javac task provides. Hope it helps.