You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Jim Adams <Ji...@sas.com> on 2008/01/24 22:08:00 UTC

Triggers and Event attributes

I am trying to write a trigger that happens at post-resolve-dependency time. I don't want this trigger to run every time I run a resolve (which happens several times for us), just sometimes. Also I want the trigger to also run a resolve with a different configuration. So I thought I would filter on the configuration that was resolved. Turns out that is not available. Is there anything else I can do? Without the configuration check I get into an infinite loop since it triggers for the calling module as well as all the dependencies.

So 2 questions. How to turn off triggers during a build and how to get just the dependencies.

Jim Adams
Jim.Adams@sas.com
Principal Systems Developer
SAS Institute



Re: Triggers and Event attributes

Posted by Xavier Hanin <xa...@gmail.com>.
On Jan 24, 2008 10:08 PM, Jim Adams <Ji...@sas.com> wrote:

> I am trying to write a trigger that happens at post-resolve-dependency
> time. I don't want this trigger to run every time I run a resolve (which
> happens several times for us), just sometimes. Also I want the trigger to
> also run a resolve with a different configuration. So I thought I would
> filter on the configuration that was resolved. Turns out that is not
> available. Is there anything else I can do? Without the configuration check
> I get into an infinite loop since it triggers for the calling module as well
> as all the dependencies.
>
> So 2 questions. How to turn off triggers during a build and how to get
> just the dependencies.

I think the best thing you can do is use a different resolveId for each
resolve, and then use this resolveId to know what to do in your trigger. To
access the resolveId in the trigger you can use IvyContext:
IvyContext.getContext().getResolveData().getOptions().getResolveId()

Xavier


>
> Jim Adams
> Jim.Adams@sas.com
> Principal Systems Developer
> SAS Institute
>
>
>


-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/