Can standard Sun javac do incremental compiling?

前端 未结 4 721
小鲜肉
小鲜肉 2020-12-14 01:01

Recently I started to use Eclipse\'s java compiler, because it is significantly faster than standard javac. I was told that it\'s faster because it performs incremental comp

4条回答
  •  盖世英雄少女心
    2020-12-14 01:38

    Restating what I've heard here and phrasing it for lazy folks like me:

    You can achieve incremental builds with the javac task in ant, but you should use the depend task to clear out .class files for your modified .java AND you must not leave the includes statement unspecified in the javac task. (Specifying just src path in the javac task and leaving includes unspecified causes javac recompile all sources it finds.)

    Here are my depends and javac tasks. With the standard Oracle java compiler, only .java files I modify are compiled. Hope this helps!

    
        
        
    
    
    
        
        
           
    
    

提交回复
热议问题