The aproach of jhon is probably safer.
I think the default value is actually ${ivy.home}/cache , and if ivy.home is
not set, it defaults to ${user.home}/.ivy/cache.
Gilles
> -----Original Message-----
> From: John Gill [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 12, 2007 2:06 PM
> To: [email protected]
> Subject: Re: Getting to the default cache path in ant
>
> Not sure if you can get a property to the cache location "out
> of the box", but I think this will work.
>
> If you specify the cache location in your ivyconf using an
> ant property (with I think is supported but I could be
> wrong), then you will be able to do it.
>
> Add this bit to your ivyconf keeping all the other stuff you have.
>
> <ivyconf>
> <conf defaultCache="${myCacheLocation}"/>
> </ivyconf>
>
> And in your ant build file set the have the following:
>
> <property name="myCacheLocation"
> location="${user.home}/.ivy/cache"/> <!-- you could set this
> to something else if you like -->
>
> <target name="clean-ivy-cache">
> <delete dir="${myCacheLocation}"/>
> </target>
>
> I haven't tried this, but it should work (assuming ivyconf
> knows about ant properties that is).
>
> I think the only problem you would have is if you are using
> ivyDE, as I don't know if and how ant properties defined in
> your build file would be passed to ivyDE. Maybe someone can
> explain that to me.
>
> On 1/12/07, Jacob Grydholt Jensen <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I have a basic ivy configuration:
> >
> > <ivyconf>
> > <conf defaultResolver="bk-repository"
> > defaultConflictManager="all" />
> <!-- in order to
> > get all
> > revisions without any eviction -->
> >
> > <resolvers>
> > <filesystem name="bk-repository">
> > <ivy pattern="${dest.repo.dir
> > }/[organisation]/[module]/ivys/ivy-[revision].xml"/>
> > <artifact
> > pattern="${dest.repo.dir
> > }/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
> > </filesystem>
> > </resolvers>
> > </ivyconf>
> >
> >
> > The cache is then set to .ivy in the user's home directory. I would
> > like to create an ant-target that deletes the cache
> directory. Can I
> > get to a property that will point to the default cache-location? I
> > have run the configure task with ant -v and got the
> following snippet:
> >
> > [...]
> > ivy-configure:
> >
> > parsing buildfile
> > jar:file:/T:/apache-ant-1.6.5/lib/ivy-
> > 1.4.1.jar!/fr/jayasoft/ivy/ant/antlib.xml
> > with URI = jar:file:/T:/apache-ant-1.6.5/lib/ivy-
> > 1.4.1.jar!/fr/jayasoft/ivy/ant/antlib.xml
> >
> > Loading jar:file:/T:/apache-ant-1.6.5/lib/ivy-
> > 1.4.1.jar!/fr/jayasoft/ivy/ivy.properties
> >
> > [ivy:configure] :: Ivy 1.4.1 - 20061109165313 ::
> http://ivy.jayasoft.org/::
> > [ivy:configure] jakarta commons httpclient not found: using jdk url
> > handling [ivy:configure] :: configuring :: file =
> > L:\bookline\HEAD\ivy-config\ivy-conf-bookline.xml
> > [ivy:configure] no default ivy user dir defined: set to
> C:\Documents
> > and Settings\jajensen\.ivy [ivy:configure] no default cache
> defined:
> > set to C:\Documents and Settings\jajensen\.ivy\cache
> [ivy:configure]
> > configuration done (78ms)
> > [ivy:configure] default cache: C:\Documents and
> > Settings\jajensen\.ivy\cache
> > [ivy:configure] default resolver: bookline-repository
> > [ivy:configure] -- 1 resolvers:
> > [ivy:configure] bookline-repository [file]
> > [...]
> >
> > The used cache location is outputted, but I cannot tell whether ivy
> > stores the cache location somewhere.
> >
> >
> > Best regards,
> >
> > Jacob Grydholt
> >
>
>
>
> --
> Regards,
> John Gill
>