This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Automatically executing targets on change Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Automatically executing targets on change" Watch "Automatically executing targets on change" New topic
Author

Automatically executing targets on change

Carl Tardif
Greenhorn

Joined: Jul 04, 2006
Posts: 8
Greetings,

It will be easier to illustrate what I want to do with an example:

When we "deploy", we copy everything from our main/deploy folder to our generated build/deploy folder.

I would like to know if it is possible for Ant to copy ONLY the files that were modified since the last deploy and how to achieve this ?

Also, would it be possible for Ant to detect changes in the main/deploy folder and to automatically do the deploy when a change is made to any file in main/deploy ?

I've looked for a way to achieve this in the ant manual and accross the web, I have seen the <UpToDate> task but I fail to see how to actually include it in my code to be able to automatically detect changes to files in a folder and then call a target only on modified files when such a change is detected.

All help is appreciated. Thanks in advance.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

Normally Ant won't copy files unless they've changed. Have you tried a simple <copy> and verified that it won't do that?


Customer surveys are for companies who didn't pay proper attention to begin with.
Carl Tardif
Greenhorn

Joined: Jul 04, 2006
Posts: 8
Yes I have tried that and it works as it should. I also found out there is no way to automatically trigger a target when a file is modified.

Thanks for the reply, I think I will have to look for a workaround to this.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Automatically executing targets on change
 
Similar Threads
Problem in detecting Resolution change
Flex 3 with Java: Is flex matured enough to really support enterprise applications?
How to Use VSS Ant tasks to get only last modified files?
Web App Deployment
Modification of JSP file using ANT