ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject for loop in ant.bat fails on ant-1.5.1 on Windows 9x
Date Fri, 24 Jan 2003 20:07:09 GMT

I thought you might be interested in a fix for problem I ran into with ant-1.5.1.

First I had to change:
if exist "%ANT_HOME%" goto checkJava
if exist "%ANT_HOME%"\nul goto checkJava

I think this has already been reported in bug 14495.

Then I found the for loop in :checkJava couldn't handle the second dot in ant-1.5.1.  In other
words, the for loop worked fine with ant-1.5 but not ant-1.5.1 when the .1 was added.  I also
found it wasn't a matter of being too long; it just plain didn't like seeing another extension.

To get it to work I changed:
for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%i
rem Substitute virtual disk z: for %ANT_HOME% in for loop.
subst z: %ANT_HOME%
for %%i in ("z:\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%I

and after :end I added:
rem Delete virtual disk z: used above.
if exist z:\nul subst z: /d

The for loop was happy with the set (z:\lib\*.jar).



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message