You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Garnier <da...@etudier-online.com> on 2004/01/14 23:18:58 UTC
[SOLVED]Re: Getting a list of directories in a variable
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 <da...@etudier-online.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org