You can use the function string::replace(), if this does not work for you use the copy or move task with filterchain and replacestring. I use this function and tasks to set a version number on a C++ assembly.
<!-- Version -->
<attrib file="build.number" normal="true" /><
version path="build.number" buildtype="MonthDay" startdate="01.01.2000" revisiontype="Automatic" ></version><foreach item="Line" in="build.number" property="get.number"><
property</foreach><
property name="build.number" value="${version::get-major(version::parse(build.number))}.${version::get-minor(version::parse(build.number))}.${version::get-build(version::parse(build.number))}.${version::get-revision(version::parse(build.number))}" unless="${build.type}" /><property name="build.number" value="${version::get-major(version::parse(build.number))}.${minor.version}.${version::get-build(version::parse(build.number))}.${version::get-revision(version::parse(build.number))}" if="${build.type}" />"
<property name="version" value
="${string::replace(build.number,'.',', ')}"/>Set Version to aa C++ assmbly
<move file="${source.dir}${assem.dir}\app.rc" tofile="${source.dir}${assem.dir}\app1.rc">
<filterchain><
replacestring from="1,0,0,1" to="${version}"/><replacestring from="1, 0, 0, 1" to="${version}" /></
filterchain></move> <move file="${source.dir}${assem.dir}\app1.rc" tofile="${source.dir}${assem.dir}\app.rc" overwrite="true" />
Best Regards
Dan
--------- Original-Nachricht --------
Von: "El Gringo" <[EMAIL PROTECTED]>
An: "[email protected]" <[email protected]>
Betreff: [NAnt-users] Parsing output
Datum: 29/05/06 15:39
Hello,
i am using svn to get my code files. Now i want nant to genereate
automaticly a "version" file of this build. So I use the following code:
! <exec program="${svndir}\svn" commandline="info ${repos}" append="true"
output="${webprojectpath}\VERSION.TXT"
basedir="${project::get-base-directory()}" failonerror="false"/>
This works fine, but I still want a few parts in "VERSION.TXT" to be
replaced. Is ther a way to do some regexp on the output?
Thanks
Pete Koller
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users
________________________________________________________________
Diese Mitteilung wurde von http://www.breitband.ch uebermittelt.
Einer der schnellsten Kabel-Internet Zugaenge!
