It's not required to create an ivy.xml for you build-dependencies, you can
resolve them inline in your build.xml.
The build.xml of Ivy uses this approach, for instance to load the emma taskdef:
<target name="emma" depends="jar" unless="skip.test">
<ivy:cachepath organisation="emma" module="emma" revision="2.0.5312"
inline="true" conf="default" pathid="emma.classpath"
log="download-only" />
<ivy:cachepath organisation="emma" module="emma_ant"
revision="2.0.5312"
inline="true" conf="default" pathid="emma.ant.classpath"
transitive="false"
log="download-only" />
<taskdef resource="emma_ant.properties">
<classpath refid="emma.classpath" />
<classpath refid="emma.ant.classpath" />
</taskdef>
...
</target>
Cfr. https://svn.apache.org/repos/asf/ant/ivy/core/trunk/build.xml
regards,
Maarten
----- Original Message ----
From: Mitch Gitman <[email protected]>
To: [email protected]
Sent: Wed, March 10, 2010 10:02:56 PM
Subject: Re: Use ivy-dependencies to create ant-tasks
Marc, doing everything at once at init sounds a bit heavyweight and
monolithic. Imagine you're resolving and retrieving 15 different task
libraries when all you need for a given build is two or three.
Instead, I would obtain tasks on an as-needed basis. So for example, the
moment you need a particular task is the moment you do:
1. ivy:resolve
2. ivy:retrieve
3. taskdef
But this approach also presumes that you've created more fine-grained Ivy
confs that correspond to your different optional tasks.
BTW, when you're using two different Ivy module descriptors in a build, make
sure to specify the file attribute on the ivy:resolve each time so Ivy
doesn't use the wrong one. Good habit anyway, as far as I'm concerned.
On Wed, Mar 10, 2010 at 12:46 PM, marcdb <[email protected]> wrote:
>
> Hi Mitch,
>
> Thanks for your suggestion. I'll try to do the following:
> In my central build file (used for building all projects), I will create an
> init-target which will:
> * execute an ivy:init
> * do an ivy:retrieve using that common ivy.xml file for the dependencies of
> my build-system itself. The appropriate versions of the jars that I need to
> create my ant-tasks will then be retrieved in an appropriate directory for
> my build-system.
> * call the <taskdef> task in ant, to create/define the additional ant-tasks
> that I need.
>
> I hope this will work. It actually seems simplier than I first thought
> :thinking:
>
> Regards,
> Marc
>
>
> --
> View this message in context:
> http://old.nabble.com/Use-ivy-dependencies-to-create-ant-tasks-tp27850372p27855533.html
> Sent from the ivy-user mailing list archive at Nabble.com.
>
>