ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Convertion from shell to ant target
Date Wed, 19 Apr 2006 14:16:25 GMT
># 12 : Check errors at build.msg and the logs
>echo "Check there any errors "
>cd $IMF/build
>rm -rf /usr/local/error.txt
>#grep " Error" *.log *.msg > /usr/local/error.txt grep " Failed" *.log
*.msg >> /usr/local/error.txt

some kind of
<delete file="/usr/local/error.txt"/>
<concat tofile="/usr/local/error.txt">
    <fileset dir="" includes="*.log,*.msg"/>
        <linecontains><contain value=" Error"/></linecontains>
<concat tofile="/usr/local/error.txt" append="true">
    <fileset dir="" includes="*.log,*.msg"/>
        <linecontains><contain value=" Failed"/></linecontains>

Maybe you could combine the two <concat>s ...

>count=`cat /usr/local/error.txt|wc -w`
>echo $count
>if [ ``$count'' = ''0'' ]

If you modify the filterchain to only write "Error" or "Failed" and
ignore empty lines, you should
a) a file with lot of "Error" and "Failed" strings or
b) an empty file
In that case
  <loadfile property="status" srcfile="/usr/local/error.txt"/>
should a) set 'status' to something or b) doesnt set 'status'.

You could do a <fail if="status"> then.

>sleep 2

why sleeping?

># 13 : Create mail file
>echo "Runnning create mail script"
>echo "To:$maillist" > /usr/local/mail.txt echo "Subject:Build 
>Summary :: $product/$VER-$RELN/$status"


A conditional mail via conditional targets or AntContrib:if

Only ideas - nothing nested ;-)


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

View raw message