ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey N. Solofnenko" <>
Subject Re: Removing duplicate jars from classpath
Date Thu, 18 Aug 2005 18:01:51 GMT
I do it with Jython as following, but, depending on what you actually 
need to do, it can be done easier by filtering all values via LinkedHashSet:

  <scriptdef name="setpath" language="jython">
    <attribute name="name" />
    <attribute name="path" />
    <![CDATA[# setpath
import os
import java



for elem0 in path.split(';'):
  for elem in elem0.split(
    if not pathSet.has_key(canon_elem):

project.setProperty(name, path)]]>

timt asml wrote:
> Hi,
>   We've recently moved part of our build environment from traditional
> unix make to
>   ant, and we're encountering some problems (ant 1.6.2, by the way)
>   - We have an hierachical archive organization, in which individual
> programmers only work on
>     single components of the product. Typically, a single component is
> a single jar.
>   - Each developer works in a partial cpy of a so-called gate archive.
> This gate-archive contains
>     the jar's for all components in the archive.
>   We  now build a class path using the following snippet:
> <available file="${}" type="dir" property=""/>
> <available file="${jlib.gate}" type="dir" property="jlib.gate.available"/>
>   <path id="cmgr.classpath">
>     <fileset dir="${}">
>       <include name="*.jar"/>
>     </fileset>
>     <fileset dir="${basedir}">
>       <include name="${jlib.gate}/*.jar" if="jlib.gate.available"/>
>      </fileset>
>   </path>
>   Clearly, this leads to some duplication: the gate archive also
> contains the component jar, and we're
>  somewhat worried about picking up the wrong version of the jar file.
>   How do I exclude a file which is already in the path from being
> added to the path ?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

/ Alexey N. Solofnenko
MDL Information Systems, Inc.
work: 510-357-2222x1726

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message