aspose file tools*
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
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: 16246
    
  21

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Automatically executing targets on change