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: manipulating property strings
Date Mon, 31 Jan 2005 13:03:02 GMT
Maybe using <redirector>.
Something like:

<exec executable="perl" dir="${mirror.bin}" 
      outputproperty="null.storage"
 	error="${mirror.bin}/temp.out">
    <redirector outputproperty="redirector.out"
                errorproperty="redirector.err"
                inputstring="blah before blah"> 
        <filterchain>
            <linecontains>
                <contains value="*** ERROR"/>
            </linecontains>
        </filterchain>
    </redirector>
</exec>


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: michael sorens [mailto:msorens@myrealbox.com]
> Gesendet am: Samstag, 29. Januar 2005 22:14
> An: user@ant.apache.org
> Betreff: manipulating property strings
> 
> Is there a way to manipulate the contents of a multi-line 
> property string as if it were a file?
> Right now I collect stderr of an exec to a temp-file 
> (error="filename") then read the temp-file and manipulate via 
> filterchain, storing into a property, as in:
> 
> <exec executable="perl" dir="${mirror.bin}"
> 	outputproperty="null.storage"
> 	error="${mirror.bin}/temp.out">
> ...
> </exec>
> 
> <loadfile srcfile="${mirror.bin}/temp.out" property="run.error">
> 	<filterchain>
> 		<linecontains>
> 			<contains value="*** ERROR"/>
> 		</linecontains>
> 	</filterchain>
> </loadfile>
> 
> ...then deleting the temp-file.
> 
> I'm looking for a more elegant solution.
> 
> ---------------------------------------------------------------------
> 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