• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

*NEWBIE* Ant compile attribute

 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • 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?
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Okay I just wanted to make sure. Maybe I'm just not noticing the time difference.
 
Tina Coleman
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • 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.
 
Ken Krebs
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic