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=4345>. 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=4345 Request for addition of "rcproperty" attribute to <exec> Summary: Request for addition of "rcproperty" attribute to <exec> Product: Ant Version: unspecified Platform: Other URL: http://marc.theaimsgroup.com/?l=ant- user&m=100352348524222&w=2 OS/Version: Other Status: NEW Severity: Enhancement Priority: Other Component: Core tasks AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] From: Yyy Xxx <[EMAIL PROTECTED]> Date: 2001-10-19 17:48:24 Thank you, Phil, for your outputproperty example. But I'm actually looking for an "rcproperty" attribute. I'd like to have the return code of the exec made visible to ant. For instance, suppose I exec a program and want to take action if the program fails. I could use the failonerror attribute and have the ant build fail. But it would be better if I could fail more gracefully. Here's a made-up example. The Unix diff program exits with a status(return) code of 0 if two files are the same, 1 if some differences were found, and 2 means trouble. The "diff" target causes diff to be run against two files. The (made up) rcproperty attribute would capture the status code and let <condition> analyze it. When diff returned a status code of "2", ant would automatically e-mail me a note before failing. <target name='rundiff'> <exec executable='diff' rcproperty='diff.rc'> <arg value='${file1}'/> <arg value='${file2}'/> </exec> <condition property='diff.failed'> <equals arg1='${diff.rc}' arg2='2'/> </condition> </target> <target name='check-diff' depends='rundiff' if='diff.failed'> <mail subject='*** DIFF Failed ***' message='A diff of ${file1} and ${file2} is giving us trouble.'/> <fail/> </target> <target name="diff" depends='check-diff'/>
