Thanks. This is what I was looking for. It looks like the following page from the documentation is what I had been overlooking: http://ant.apache.org/ivy/history/2.1.0-rc1/settings/triggers.html
On Mon, May 4, 2009 at 10:40 PM, Garima Bathla <[email protected]>wrote: > Well there are triggers in Ivy but you can only invoke a trigger to a > predefined event. You can create your own triggers and then tell IVY about > the classpath, and typedef the trigger and then register it. > > e.g. > > https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/trigger/Trigger.java > > MyTrigger implements Trigger { > ... > } > > In ivysettings.xml > > <classpath file="path/to/you/custom/build/trigger.jar> > <typedef name="MyTrigger" classname="path.to.MyTrigger.in.trigger.jar"> > > <triggers> > <MyTrigger event="pre-defined-ivy-events"/> > </triggers> > > I hope it will work, I haven't tried it out yet. > > Regards, > Garima. > > > On Mon, May 4, 2009 at 10:29 PM, Mitch Gitman <[email protected]> wrote: > > > I'm interested in registering an *IvyListener *implementation to listen > for > > an *IvyEvent *of some sort. Assume we're working within an Ant script. > > > > Now, I see that it's easy enough to register an *IvyListener ** > > programmatically*. Just obtain an *EventManager *like so: > > IvyContext.getContext().getEventManager(); > > > > And then on *EventManager*, I can call addIvyListener(...) to my heart's > > content. > > > > But then I have to ask myself, "Why do I have to do this > programmatically? > > Why not just do it in the Ant script?" Here's an example from the Javadoc > > for one particular *IvyListener*, *AntBuildTrigger*, at > > doc/reports/api/org/apache/ivy/ant/AntBuildTrigger.html: > > <ant-build-trigger event="pre-resolve-dependency" > > filter="revision=latest.integration" > > antfile="/path/to/[module]/build.xml" > > target="compile"/> > > > > So I'm figuring that there's a typedef preceding this to associate the > > element ant-build-trigger with the *AntBuildTrigger *class. But the above > > XML appears just to instantiate the trigger, not register it. > > > > So does some XML like the above suffice to actually register the listener > > and not just declare it? Or is there some extra XML needed to actually > > register the listener with Ivy? > > > > Thanks. > > >
