ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Burkhardt Stefan (CI/TMP)" <Stefan.Burkha...@de.bosch.com>
Subject AW: AW: Ivy classpath creation
Date Thu, 16 Oct 2008 11:00:35 GMT
I now constructing the classpath with the following command:

       <path id="test.classpath"/>
       <ivy:cachepath pathid="test.classpath"/>
        
       <pathconvert property="ivy.lib.classpath" pathsep=":">
           <path refid="test.classpath"/>
           <regexpmapper from="([.\s\w\-]*)[\\/]jars[\\/]([.\s\w\-\d]*).jar" to="lib/\2.jar"/>
       </pathconvert>
       <echo message="Cachepath: "/>
       <echo message="${ivy.lib.classpath}"/> 

Stefan

-----Ursprüngliche Nachricht-----
Von: Maarten Coene [mailto:maarten_coene@yahoo.com] 
Gesendet: Mittwoch, 15. Oktober 2008 22:25
An: ivy-user@ant.apache.org
Betreff: Re: AW: Ivy classpath creation

I don't think this is possible at the moment with Ivy. Please open a JIRA request for this.
However, in your example where you have a flat retrieve directory (no subdirs), you could
accomplisch such a path by using the <ivy:cachepath> and <pathconvert> tasks,
something like this:

<ivy:cachepath pathid="cache.classpath"... />

<pathconvert refid="cache.classpath" property="converted.path" ... >
    <mapper>
        <chainedmapper>
              <flattenmapper/>
              <globmapper from="*" to="lib/*" casesensitive="no"/>
        </chainedmapper>
    </mapper>
</pathconvert>
<path id="lib.path">
    <pathelement path="${converted.path}"/>
</path>

I didn't test it, but you can see the main idea...

Maarten


----- Original Message ----
From: Burkhardt Stefan (CI/TMP) <Stefan.Burkhardt@de.bosch.com>
To: ivy-user@ant.apache.org
Sent: Wednesday, October 15, 2008 3:30:13 PM
Subject: AW: Ivy classpath creation

Hi,

The ivy:cachepath points also to the cache and not to the lib directory. The option useOrigin
makes no difference. I tried it with beta-2 and RC-1.

I need something like "lib/commons-logging-1.0.4.jar:lib/spring-2.5.5.jar:lib/spring-test-2.5.5.jar"

Am I missing something.

Stefan
  


-----Ursprüngliche Nachricht-----
Von: Nicolas Lalevée [mailto:nicolas.lalevee@hibnet.org] 
Gesendet: Dienstag, 14. Oktober 2008 17:29
An: ivy-user@ant.apache.org
Betreff: Re: Ivy classpath creation

Le mardi 14 octobre 2008, Burkhardt Stefan (CI/TMP) a écrit :
> Hi,
>
> I am using the following command to get my artefacts within my
> ANT-Script.
>     <ivy:retrieve
> pattern="${basedir}/lib/[artifact]-[revision].[ext]" type="jar,source"
> sync="true"/>
> It retrieves the artefacts and put the jar-files into my "lib"-folder.
>
> First Question is:
> - How can I create a classpath based on the artefact resolution and not
> from the directory. Is there a similar command like "cachefileset" for
> the "lib" directory.
>   Is there a way to create a classpath from the resolution report?

yep, see:
http://ant.apache.org/ivy/history/latest-milestone/use/cachepath.html

>
> Second question is:
> - I am using subversion and I will check in the complete lib folder with
> the jar-files. But the option "sync=true" will delete the complete
> folder. So the
>   subversion-Folder is removed too. Any Ideas to handle this?

You could just not commit your lib directory and svn:ignore it.

Nicolas



      

Mime
View raw message