ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19099] New: - [PATCH] add resultproperty support to <java>
Date Thu, 17 Apr 2003 00:18:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19099>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19099

[PATCH] add resultproperty support to <java>

           Summary: [PATCH] add resultproperty support to <java>
           Product: Ant
           Version: 1.6Alpha (nightly)
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: donal@savvion.com


I have an attachment, but can't see where to attach it.

I use 3rd party java software that returns -1 whenever it issues a warning.
These warnings are harmless. Whenever an error occurs -2 is returned. To make
the build fail on real problems it is necessary to catch the exit code. This
patch takes the resultproperty code from the <exec> task and grafts it onto the
<java> task. Exit code can only be non zero when failonerror=false and when
fork=true.

Here is an example on how to use it.

     <java classname="test.Main"
           fork="true"
           failonerror="false"
           resultproperty="exitcode"
           >
     </java>
     <condition property="good.build">
       <or>
         <equals arg1="${exitcode}" arg2="0" />
         <equals arg1="${exitcode}" arg2="-1" />
       </or>
     </condition>
     <fail unless="good.build"
           message="Unexpected exit code: exitcode = ${exitcode}"/>

Mime
View raw message