I have an Ant build where I only want to rebuild an artifact if its dependencies is updated.
For the external dependencies, this is easy since I can just compare the change date for ivy.xml with the created date of the artifact (with uptodate). But this does not work for internal dependencies where I use latest.release to define the revision of the dependency. Like this:
<dependencies>
<dependency org="se.woop" name="thelibrary" rev="latest.release" conf="default->*"/>
</dependencies>
In this scenario the project thelibrary can result in a new version without a change in the ivy.xml file. I would like something like the checkIfChanged on the resolve task on the retrieve task.
Any suggestion on how this can be solved?
Edit:
I realized that I might be able to use the uptodate function to check my library folder agains the latest produced artifactory as well, and it almost works. This is what my uptodate looks like:
<uptodate targetfile="build/artifacts/theclient.jar" property="artifact.uptodate">
<srcfiles dir= "src" includes="*"/>
<srcfiles dir= "lib" includes="*"/>
<srcfiles dir= "." includes="ivy.xml"/>
</uptodate>
The problem is that the uptodate function compares against the changed date of the artifacts in the library folder. However when the files are copied to the library folder (by Ivy) the changed date is not updated, but the created date is.
So... is it possible to make the uptodate compare against the created date instead? Or is it possible to make Ivy update the changed date when moving dependencies into the library folder? Or is it another solution available?