You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/01/24 22:00:00 UTC
DO NOT REPLY [Bug 16408] New: -
For loop in ant.bat fails in ant-1.5.1 on Windows 9x
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=16408>.
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=16408
For loop in ant.bat fails in ant-1.5.1 on Windows 9x
Summary: For loop in ant.bat fails in ant-1.5.1 on Windows 9x
Product: Ant
Version: 1.5.1
Platform: PC
OS/Version: Windows 9x
Status: NEW
Severity: Normal
Priority: Other
Component: Wrapper scripts
AssignedTo: ant-dev@jakarta.apache.org
ReportedBy: jbiskeborn@msn.com
I thought you might be interested in a fix for a problem I had with ant.bat in
ant-1.5.1.
First, I had to change:
if exist "%ANT_HOME%" goto checkJava
to:
if exist "%ANT_HOME%"\nul goto checkJava
I think this has already been reported in bug 14495.
Then, I found the for loop at :checkJava no longer worked. It worked fine with
ANT_HOME=\ant-1.5 but not ANT_HOME=\ant-1.5.1 with the .1 added. It wasn't a
matter of the path being too long. It just didn't like seeing more than one
extension. In other words, the for loop accepted 1 followed by .5 but not 1
followed by .5 followed by .1.
To get it to work I changed:
for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%i
to:
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
After :end I added:
rem Delete virtual disk z: used above.
if exist z:\nul subst z: /d
This solution depends on the last drive being set to z:, which it is in Windows
Me and probably Windows 98, and the z: drive not being used, which is probably
the case. There's probably a way to detect if both of these conditions are
true.
I think it's important that ANT_HOME include the version number so users can
write scripts that check the version number.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>