How to compile only modified source files using ANT

I am trying to write ant build to compile the source folder, here is my script target for compilation.

 <target name="compile" depends="init">
        <javac srcdir="${src.dir}" destdir="${classes.dir}" debug="true">
            <classpath refid="master-classpath"/>
        </javac>

    </target>

In my project I have about 1000 files .java. When ever one file .javachanges above, it seeks to compile all files .java. This makes development very slow. I just want to know if there is a way or code to change the behavior of a task to compile only a modified or modified file .java, not the whole file .java.

Please help me.

+5
source share
2 answers

, java - ant javac. ant .java .class, , Java. ​​ .

,

  • , Java ? . ant Java ?. , 1, FAQ.

  • , compile init? init? - clean .class?

  • ant? ant, , ?

  • , .class .java ?

+10

, , "clean", javac java . , javac. , .

+1

All Articles