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: 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"/>
    <filterchain>
        <linecontains><contain value=" Error"/></linecontains>
    </filterchain>
</concat>
<concat tofile="/usr/local/error.txt" append="true">
    <fileset dir="" includes="*.log,*.msg"/>
    <filterchain>
        <linecontains><contain value=" Failed"/></linecontains>
    </filterchain>
</concat>

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


>count=`cat /usr/local/error.txt|wc -w`
>echo $count
>
>if [ ``$count'' = ''0'' ]
>then
>status=Pass
>else
>status=Fail
>fi


If you modify the filterchain to only write "Error" or "Failed" and
ignore empty lines, you should
get:
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"
>>>/usr/local/mail.txt


<mail>

A conditional mail via conditional targets or AntContrib:if



Only ideas - nothing nested ;-)


Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message