In an ant build script, is there a way to check if the files in one folder have been changed or added to since the last build, and then conditionally run a target based on that check?
My project has three assets
folders, one for each of three platforms, which the main Java app pulls from when it runs. I have one etc
folder with the raw versions of the files, where I make changes that need to be propagated to the three assets
folders.
I have a target that packs the images and copies the files over. It is going to take longer and longer to run this target as the project grows in size, so I would only like this target to run when there's been a change in the etc
folder since the last time it was run.
My first thought was to compare the date created/modified values between etc
and one of the assets
folders, which works for files simply copied over. For the packed images, it could check all the images in etc
and get the most recent created/modified date, and see if that's newer than the packed image files in assets
.
But I don't know how to implement this in an ant build script. Is there a built-in way to do this? If not, are there easy-to-import tools to do this?