• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Last Modified Time stamp from Ant script

 
Bhaarat Sharma
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can someone please tell me if there is a way in Ant Script to compile files only which have a 'last modified' time stamp between 2 minutes of current time?

Actually the reason is that I am coming from Websphere and Netbeans background where build scripts are automatically made for you. But now I have to run a Build script made by someone to compile my project. Even if a single System.out.println statement is changed in one file..the build script compiles all 150 source files which takes a long time.

I am wondering if it can, like websphere and netbeans, only compile the the the files which I have made changes in.

I'd appreciate any tips.

Thanks
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bhaarat sharma:


I am wondering if it can, like websphere and netbeans, only compile the the the files which I have made changes in.

I'd appreciate any tips.

Thanks


Take a look at the javac task documentation from ant manual. It is the default behavior to only compile the changed files if you specify the source directory like ant expects.

The source and destination directory will be recursively scanned for Java source files to compile. Only Java files that have no corresponding .class file or where the class file is older than the .java file will be compiled.


If you don't get it working from reading the manual on javac, then post the relevant part of your build file.
 
Bhaarat Sharma
Ranch Hand
Posts: 96
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks I'll post relevant code from build script.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic