On Oct 9, 2008, at 11:37 PM, Victor Ott wrote:

On Thu, Oct 9, 2008 at 11:15 AM, Hans Dockter <[EMAIL PROTECTED]> wrote:
Hi Victor,

On Oct 9, 2008, at 8:00 AM, Victor Ott wrote:

Hans,

"exit /B code" did NOT deliver the error code, when I tried it the day
before yesterday. Only "exit code".
But I'll take again a look at it.


What we could do is to introduce an environment variable. Let's call it EXIT_CONSOLE. We would check in the gradle.bat/cmd if this is set. If so we would trigger an 'exit 1'. The main use case for this are CI servers. With Bamboo or Teamcity you can easily define such environment variables. In our test script we could easily set this as well. The normal windows user would
not be affected by this.

What do you think?

- Hans

Hans, sorry, I didn't get to reply earlier.
Yes, I think it's a good idea. Seems to me that this also the reasoning for http://continuum.apache.org/faqs.html#how-does-continuum-detect-a- successful-build-with-ant
(Disclaimer: No, I'm using neither Continuum, nor Maven.)

I only wonder if we shouldn't do a similar game like in the link above
with and without "/b", e.g.:
=========================
rem Set variable EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%EXIT_CONSOLE%" exit %the_code%
exit /b %the_code%
=========================
This way the return code gets to both callers, interactive and scripted.

What do you think about the following?:

'exit %the_code%' would be equivalent in its effect to the weird 'color 00' call. The side effect of using 'exit' were, that it would not run under Win95/98 (I can perfectly live with that) but that we can return a non zero exit value to Java programs calling this script (see script above). If we use 'exit', we might as well move from .bat to .cmd to have a more powerful shell language available (which can't be used for Win9x). The probably very tiny (or zero) numbers of Win9x users can always use cygwin to run Gradle.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to