ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: Searching a log file for "Error" string
Date Wed, 28 Jan 2004 09:29:25 GMT
The following should do the trick in a verbose fashion.

    <loadfile property="" srcfile="compiler.log">
          <contains value="Error"/>

    <condition property="has.error">
      <contains string="${}" substring="Error"/>

    <fail if="has.error">
      It had an error


James Millet wrote:

>One of the tasks in my build process is an 'exec' task that invokes a C++
>compiler with its output going to a file specified in the "output"
>attribute of the exec task. I would like to search that output file for the
>string "Error" and fail the build if it is found. I see how to use the
>"fail" task with it's 'if' and 'unless' attributes for properies, so my big
>problem is how to do the search for "Error" and set (or not set) a
>I see <linecontains>, but that seems to be in the context of copying and I
>am not doing any copies.
>Any suggestions?
>Jim Millet
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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

View raw message