Silly me, I had the solution just in front of my eyes on a webpage I've
googled an hour ago. I haven't seen it anywhere in the plugins, so here
it goes:

<dirset dir="${basedir}/../networks/" id="network.dirs"/>
     <pathconvert pathsep="," property="networkDirs"
refid="network.dirs"/>
      <u:tokenize var="networkList"
delim=",">${networkDirs}</u:tokenize>
<j:forEach var="network" items="${networkList}">

        <u:available file="${network}/res/graph.dat"> 
          <!-- snip -->
       </u:available> 
</j:forEach>

Best Regards,
David Garnier
  
Le mer 14/01/2004 � 23:05, David Garnier a �crit :
> Hello,
> 
> I would like to collect a list of directory in a variable, in order to
> feed a foreach loop. I have several datasets, each one composed of 3
> files. Each dataset is in a different directory, and every directory is
> in a directory called network. Today, I just move the right dataset in
> place, build it and move away the result. Example:
> 
>  <j:set var="networkDirs" value="Sapporo,Tokyo" />
>       <u:tokenize var="networkList"
> delim=",">${networkDirs}</u:tokenize>
>       <j:forEach var="dir" items="${networkList}">
>         <j:set var="network" value="${basedir}/../networks/${dir}" />
>  
>         <u:available file="${network}/res/graph.dat"> 
>         <echo>Packaging ${network}</echo>
>         <copy todir="${basedir}/res">
>         <fileset dir="${network}/res/">
>         <include name="*.dat"/>
>         </fileset>
>         </copy> 
> 
>         <attainGoal name="jar:jar"/>
>         <copy todir="${network}/">
>         <fileset dir="${basedir}/target/bin/">
>         <include name="*.jar"/>
>         </fileset>
>         </copy>
> 
>        </u:available>
> 
> This work quite well but I would like to collect the names of the
> directory automatically. I have hundreds of them...
> 
> Best Regards,
-- 
David Garnier <[EMAIL PROTECTED]>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to