• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

*NEWBIE* Ant compile attribute

 
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From what I understand, when ANT is compiling source files, it should skip source files that have been previously compiled and wasn't changed since. But for some reason it doesn't appear to be doing that for me. Is there some attribute I have to set to trigger this behavior?
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be doing it automatically. It checks to see which is older, the .java file or the .class. If the .class is older, then it compiles. If you are saving your .java files without changes it will still treat it as if it has been changed.
 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay I just wanted to make sure. Maybe I'm just not noticing the time difference.
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Verify that the script's not deleting and then making the directory in which you've stored your class files, too. . . Makes for long compile/test cycles, otherwise.
 
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe you need to invoke the <tstamp/> task, probably in your init target if you have one. This will set several properties based on the current system time. The javac task uses these properties to determine whether a source file is out-of-date and needs to be rebuilt.
 
reply
    Bookmark Topic Watch Topic
  • New Topic