• 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

Last Modified Time stamp from Ant script

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks I'll post relevant code from build script.
 
reply
    Bookmark Topic Watch Topic
  • New Topic