ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Crahen" <eric.crahen.li...@gmail.com>
Subject Re: Re[2]: Getting to the default cache path in ant
Date Sat, 13 Jan 2007 04:36:34 GMT
Theres a JIRA issue to provide cache invalidation that you could vote for as
well.
https://issues.apache.org/jira/browse/IVY-321
https://issues.apache.org/jira/browse/IVY-358

On 1/12/07, Dmitriy Korobskiy <dkroot1@gmail.com> wrote:
>
> John,
>
> Your assumption is correct - Ant properties are available in Ivy
> configuration
> files and Ivy files. We are using it extensively in our builds.
>
> Unfortuntately, the Ant properties would not be available from Eclipse
> (IvyDE)
> which might be a problem.
>
> I have tried 2 workarounds for IvyDE:
>
> 1. Use a wrapper configuration file for IvyDE which includes the "master"
> configuration. For example:
>
> <ivyconf>
>   <property name="env.Java3PL" value="C:\Java3PL"/>
>   <property name="env.IvyCache" value="C:\Builds\ivy-cache"/>
>
>   <include file="${env.Java3PL}\ivyconf.xml"/>  <!-- Master config -->
> </ivyconf>
>
>
> 2. Load (Ant) properties from a property file. For example:
>
> <ivyconf>
>
>   <!--
>     Define env.IvyCache and env.Java3PL in local.properties
>     TODO Figure out what relative path/URL to use
>   -->
>   <properties file="local.properties" override="true"/>
> </ivyconf>
>
> The relative path did not work for me in IvyDE. It works in Ant, but IvyDE
> could
> not find local.properties. If somebody can shed a light on this, please
> do.
>
> JG> Not sure if you can get a property to the cache location "out of the
> box",
> JG> but I think this will work.
>
> JG> If you specify the cache location in your ivyconf using an ant
> property
> JG> (with I think is supported but I could be wrong), then you will be
> able to
> JG> do it.
>
> JG> Add this bit to your ivyconf keeping all the other stuff you have.
>
> JG> <ivyconf>
> JG>    <conf defaultCache="${myCacheLocation}"/>
> JG> </ivyconf>
>
> JG> And in your ant build file set the have the following:
>
> JG> <property name="myCacheLocation" location="${user.home}/.ivy/cache"/>
> <!--
> JG> you could set this to something else if you like -->
>
> JG> <target name="clean-ivy-cache">
> JG>     <delete dir="${myCacheLocation}"/>
> JG> </target>
>
> JG> I haven't tried this, but it should work (assuming ivyconf knows about
> ant
> JG> properties that is).
>
> JG> I think the only problem you would have is if you are using ivyDE, as
> I
> JG> don't know if and how ant properties defined in your build file would
> be
> JG> passed to ivyDE. Maybe someone can explain that to me.
>
> >>
> >> 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
> >>
>
> Dmitriy <1-127-441 @ICQ, DKroot @Skype, DKroot1 @AIM,
> dkroot1_at_gmail_dot_com @Google Talk>
>
> ===8<==============Original message ===============
> From: John Gill <llignhoj@gmail.com>
> To: ivy-user@incubator.apache.org <ivy-user@incubator.apache.org>
> Subject: Getting to the default cache path in ant
> Sent: Friday, January 12, 2007
>
> 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 <grydholt@gmail.com> 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
>
> ===8<===========End of original message ===========
>
>


-- 

- Eric

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message