ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Run a ant target many times
Date Thu, 03 Jul 2003 05:44:11 GMT
I have done that also, "for each line of a file call a target".
I used AntContrib for that.


<target name="doAll">
    <loadfile property="files" srcFile="${theList}"/>
    <foreach target="doOne" 
             param="value" 
             list="${files}" 
             delimiter="${line.separator}" 
             parallel="true"/>
</target>
<target name="doOne">
    <echo> ${value} </echo>
</target>


The trick is use the delimiter ${line.separator}. In my case I have a
properties file and
want to both - key and value, so I use AntContrib┬┤s <propertyregex> in
'doOne':

    <propertyregex property="key"   input="${value}" regexp="(.*)=(.*)"
select="\1"/>
    <propertyregex property="value" input="${value}" regexp="(.*)=(.*)"
select="\2"/>



Ant-Contrib:
  Homepage:   http://sourceforge.net/projects/ant-contrib/
  CVS-Source:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ant-contrib/ant-contrib/src/n
et/sf/antcontrib/
  CVS-Manual:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ant-contrib/ant-contrib/manua
l/index.html
	
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/ant-contrib/ant-co
ntrib/manual/tasks/index.html
  Binary:     http://gump.covalent.net/jars/latest/ant-contrib/



Jan


> -----Urspr├╝ngliche Nachricht-----
> Von: Danilo Luiz Rheinheimer [mailto:danilo@floripa.com.br]
> Gesendet am: Donnerstag, 3. Juli 2003 05:26
> An: user@ant.apache.org
> Betreff: Run a ant target many times
> 
> Hello,
> 
>   I have a simple build script to :
> 
>   - download a module from CVS.
>   - zip it.
>   - upload it to FTP.
> 
>   This is working fine.
> 
>   But this process must be done on a list of CVS modules. And this
> list is on a .txt file.
>   How I can read this text file and invoke the ant targets once per
> module ?
>   I know how to write ant tasks so if I need to do it this is not a
> problem.
> 
> 
> -- 
> Best regards,
>  Danilo                          mailto:danilo@floripa.com.br
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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