ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: Help!!! How to verify if archive has some content
Date Tue, 06 May 2003 17:01:09 GMT
You can use the combination of <loadfile/> and 
<condition><contains/></condition>
as in:
  <target name="contains">
    <loadfile property="file.contents" srcfile="file.txt"/>
    <condition property="file_has_seach_string">
      <contains string="${file.contents}" substring="${search.string}"/>
    </condition>
    <echo message="has string: ${file_has_seach_string}"/>
  </target>

Peter

On Tuesday 06 May 2003 17:39, Regis Melo wrote:
> Hello!
>
> 	I want to verify if my archive contains some content. Something like this:
>
> 	if( ! myFileContains("myToken" ) )
> 		buildFail();
>
>
> 	There is any way to do this using ANT??
>
> Thanks,
>
> Regis Melo
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message