ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <n...@apache.org>
Subject Re: [Bug 314] - Return value in bin/runant.pl script BugRat Report#572
Date Sat, 21 Jul 2001 19:01:31 GMT
----- Original Message -----
From: <bugzilla@apache.org>
To: <ant-dev@jakarta.apache.org>; <sknippenberg@unwiredexpress.com>
Sent: Saturday, July 21, 2001 3:06 PM
Subject: [Bug 314] - Return value in bin/runant.pl script BugRat Report#572


 > + ------- Additional Comments From conor@cortexebusiness.com.au
2001-07-21 06:06 -------
> + Added return codes to the windows batch file

OK, the last line does now read "if %ANT_ERROR%=="yes" exit 1".

I have run the following build.xml

<?xml version="1.0"?>
<project default="main">
  <target name="main">
    <echo amessage="${java.home}"/>
  </target>
</project>

and I really expect it to fail. I removed "@echo off" from the first line of
ant.bat and get

main:

BUILD FAILED

C:\temp\build.xml:4: The <echo> task doesn't support the "amessage"
attribute.

Total time: 1 second

C:\temp>goto end
C:\temp>if errorlevel 1 set ANT_ERROR=yes
C:\temp>set LOCALCLASSPATH=
C:\temp>set _JAVACMD=
C:\temp>set ANT_CMD_LINE_ARGS=
C:\temp>if not "Windows_NT" == "Windows_NT" goto mainEnd
C:\temp>if yes == yes goto winNTError
C:\temp>set ANT_ERROR=yes
C:\temp>goto :mainEnd
C:\temp>if exist "\antrc_post.bat" call "\antrc_post.bat"
C:\temp>if yes == "yes" exit 1

So it does not work.

If I "repair" it by changing the last line to read "if "%ANT_ERROR%"=="yes"
exit 1" (setting the variable in quotes) you may call it "working" - I think
it will return 1, but it closes my cmd.exe (caused by the exit) so I will
never know (And I will not use it as is).

On which OS are you running Ant?

Nico



Mime
View raw message