About ant commands :
You can create your own command processor with ant (you are able to create elements and ant is able to process commands in ants way (using xml to join parts )
For example for search and replace there is a command that is mapped to java or to implemented in other language application
<replaceregexp file="file" match="pattern" replace="pattern"
byline="true|false" /> ;
it is actually a prepared a java class(s) that do the job
Is Ant depends on Java JRE or it is a separate native application? I think it is...
Probably that's why Java and Ant is so close...
I also would like to understand how preprocessor works in Eclipse. It may helps me with my tasks