You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Info <In...@kjs-a.com> on 2003/03/12 01:14:01 UTC

ANT: KJS#00004 Appendix_E (BookMarks) (20030311)

In the Manning & Sams books and onLine, I have not found an equivalent to
the 'c' exit(nbr) and the batch "if errorlevel" (as appropriate for an OS) -
at least that I recognize.  A page number in the books would work.  I am
very aware of try/catch/... type of processing and can control graceful
termination or continuation - this is not what I need.  I need the
capability at the system level for ANT-use to be able to make equivalent
decisions that we currently have in place using exit(nbr).  Would prefer the
suggestion as a vanilla part of ANT rather than using a plug-in that may be
a more sophisticated version of the interim-'c'/assembler/Java/ANT munge
that gets the job done but is really scary!  Said another way, we could have
from 0 to 255 possible processing-outcomes that need to launch the next
processing step and not as a Java thread (we have more than enough of those
dealing with the outliars and processing leverage-points)!  We have found
our winGate systems run out of resources if the code is written the way it
should be - hence the reason we are doing this in a step'd-wise way.

Now all that said, give me your best shot.  Maybe you have something that is
ANT-better?  It just has to fit on the winGate systems!

jimS (info@kjs-a.com)



Re: exit codes (s/b KJS#00005(20030311a))

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Info" <In...@kjs-a.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Wednesday, March 12, 2003 08:13
Subject: Re: exit codes (s/b KJS#00005(20030311a))


> 1. if you <exec> anything you can get the result code into a property;
look
> up <exec>
> p124-131 for xml and ?ExecTask class?

I know  :)

That bit strangely lacks any mention of resultproperty. I say strangely as I
added resultproperty after writing that bit of the book, but guess I didnt
feel it merited a mention other than in the list of bullet points on p125.
and look up

> ForJava I currently use System.exit(nbr); so I am not seeing the need for
a
> new task "unless" ANT cannot see this exit value.  Could the Execute class
> getExitValue method be used to see the System.exit value?  Or is it just
> local to the process?  Okay, back to the books to see where I am missing
the
> answer in <exec>.

it does. But if you run <java> and do not fork, when you call
System.exit(0), ant itself suddenly grinds to a halt.

>
> In the Execute class I see methods getExitValue and setExitValue.  Are
these
> seen and usable by ANT - specificially the setExitValue?  Could I use the
> setExitValue with "if errorlevel"?  Is the value persistent? Is the value
> stored in system space (heap)?  Can ANT see and use these values by using
> <exec> processing as mentioned in the #1 response?  The docs seem silent
to
> me.  So, back to the books and the docs again!

Look at resultproperty in the Exec manual page.



Re: exit codes (s/b KJS#00005(20030311a))

Posted by Info <In...@kjs-a.com>.
1. if you <exec> anything you can get the result code into a property; look
up <exec>
p124-131 for xml and ?ExecTask class?
2. are you trying to set the exit code of ant so that containers can call
it? It could be done with a new task <setExitCode code="234" /> *and* the
changes to ant.Main to pick this up and return it.

ForJava I currently use System.exit(nbr); so I am not seeing the need for a
new task "unless" ANT cannot see this exit value.  Could the Execute class
getExitValue method be used to see the System.exit value?  Or is it just
local to the process?  Okay, back to the books to see where I am missing the
answer in <exec>.

In the Execute class I see methods getExitValue and setExitValue.  Are these
seen and usable by ANT - specificially the setExitValue?  Could I use the
setExitValue with "if errorlevel"?  Is the value persistent? Is the value
stored in system space (heap)?  Can ANT see and use these values by using
<exec> processing as mentioned in the #1 response?  The docs seem silent to
me.  So, back to the books and the docs again!

jimS (info@kjs-a.com)

----- Original Message -----
From: "Steve Loughran" <st...@iseran.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Tuesday, March 11, 2003 7:16 PM
Subject: exit codes (was Re: KJS#00004 Appendix_E (BookMarks) (20030311))




exit codes (was Re: KJS#00004 Appendix_E (BookMarks) (20030311))

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Info" <In...@kjs-a.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Tuesday, March 11, 2003 16:14
Subject: ANT: KJS#00004 Appendix_E (BookMarks) (20030311)


> In the Manning & Sams books and onLine, I have not found an equivalent to
> the 'c' exit(nbr) and the batch "if errorlevel" (as appropriate for an
OS) -
> at least that I recognize.  A page number in the books would work.  I am
> very aware of try/catch/... type of processing and can control graceful
> termination or continuation - this is not what I need.  I need the
> capability at the system level for ANT-use to be able to make equivalent
> decisions that we currently have in place using exit(nbr).  Would prefer
the
> suggestion as a vanilla part of ANT rather than using a plug-in that may
be
> a more sophisticated version of the interim-'c'/assembler/Java/ANT munge
> that gets the job done but is really scary!  Said another way, we could
have
> from 0 to 255 possible processing-outcomes that need to launch the next
> processing step and not as a Java thread (we have more than enough of
those
> dealing with the outliars and processing leverage-points)!

0. meaningful subject lines are good

1. if you <exec> anything you can get the result code into a property; look
up <exec>

2. are you trying to set the exit code of ant so that containers can call
it? It could be done with
 -a new task <setExitCode code="234" /> *and* the changes to ant.Main to
pick this up and return it.