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:[EMAIL PROTECTED] 
>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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to