ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Widmer <>
Subject Re: Best practice for unziping bundles
Date Mon, 20 Apr 2009 13:44:22 GMT
Jonathan Roberts wrote:
> Hello,
> I'm trying to configure ivy/ant to unzip bundles when a new one is
> downloaded.  I've got:
> <triggers>
>   	<ant-call target="unzip-dependency" prefix="zip"
>         	  event="post-download-artifact" filter="type=zip AND
> status=successful"/>
> </triggers>
> That works, when the file is downloaded the first time, but I'd like to
> have a trigger that gives me a zip when it's copied from cache.  Also,
> since the ivy settings is shared across several projects, if
> unzip-dependency doesn't exist, the build fails.
> Is there a way to have the <trigger> or <ant-call> task not run if the
> task doesn't exist? Or maybe fail gracefully without killing the build?

You can just define an empty unzip-dependency task. If you have a shared 
build script (included in your project files with <include>), you can 
can put it there, and override it as necessary in any build scripts that 
do need to unzip.

> Is there a way to have a trigger that fires with all the newly copied
> zips (from cache, not just downloaded to cache)

You mean a post-retrieve trigger? I couldn't find such a thing.

> What's the best practice on this?  Am I just going about it the wrong
> way?

In the absense of a post-retrieve-artifact trigger, I do it in my ant 
script, and don't get ivy involved in unzipping things at all. e.g. in 
shared build script:

<ivy:retrieve .../>
<antcall target="post_retrieve_dependencies"/>


<target name="post_retrieve_dependencies" description="override to do 
any post-retrieve steps, such as unzipping dependencies"/>

Then individual build scripts that need to can override 
post_resolve_dependencies to do what they want.


View raw message