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: Failing a javac task due to Xlint warnings
Date Tue, 06 Mar 2007 07:41:02 GMT
My first thought was to use a <redirector> - but <javac> does not support one ...

But you could do the following:
<target name="compile">
    <ant file="${ant.file}" target="-compile" output="compile.log"/>
    <loadfile property="compile.log" srcFile="compile.log"/>
    <fail>
        <condition>
            <or>
                <contains string="${compile.log}" substring="foo"/>
                <contains string="${compile.log}" substring="bar"/>
            </or>
        </codition>
    </fail>
</target>
<target name="-compile">
    <javac ... />
</target>


So you use a redirect-feature of <ant> instead of <javac>. Not the best, but should
work.


Jan

>-----Ursprüngliche Nachricht-----
>Von: Brown, Carlton [mailto:Carlton.Brown@BellSouth.com] 
>Gesendet: Montag, 5. März 2007 22:33
>An: user@ant.apache.org
>Betreff: Failing a javac task due to Xlint warnings
>
>Hi all,
>
>I am looking for a way to cause javac to fail if certain warnings are
>encountered (deprecation, etc).    I did not see any attribute to
><javac> that would produce such behavior.   My next thought was to
>capture the stdout or stderr of javac into a property and then check it
>in a <condition> nested in a <fail> task, but I also saw no such
>property for capturing javac output.
>
>Any ideas?
>Thanks in advance....
>
>*****
>
>The information transmitted is intended only for the person or 
>entity to which it is addressed and may contain confidential, 
>proprietary, and/or privileged material. Any review, 
>retransmission, dissemination or other use of, or taking of 
>any action in reliance upon this information by persons or 
>entities other than the intended recipient is prohibited. If 
>you received this in error, please contact the sender and 
>delete the material from all computers. GA622
>
>
>

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


Mime
View raw message