ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Monsees" <>
Subject RE: Replacing text in files
Date Tue, 29 May 2007 09:28:57 GMT

> /*
> How can I replace a line from this file with some other text? I
> thought about "loadfile" or "patch", but donĀ“t know exactly if these
> would work. */ 
> use a filterchain with replaceregex or replacestring

it now works this way:

<target name="version_into_vbp">
  <replaceregexp file="${compile.project.dir}/${compile.project.vbp}"
match="MajorVer=(.*)" replace="MajorVer=${version.major}"/>
  <replaceregexp file="${compile.project.dir}/${compile.project.vbp}"
match="MinorVer=(.*)" replace="MinorVer=${version.minor}="/>
  <replaceregexp file="${compile.project.dir}/${compile.project.vbp}"
match="RevisionVer=(.*)" replace="RevisionVer=${version.revision}="/>

In case anyone else needs this some time.


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

View raw message