Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 30904 invoked from network); 8 Oct 2002 17:39:36 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 8 Oct 2002 17:39:36 -0000 Received: (qmail 29318 invoked by uid 97); 8 Oct 2002 17:40:05 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 29212 invoked by uid 97); 8 Oct 2002 17:40:04 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 29136 invoked by uid 50); 8 Oct 2002 17:40:04 -0000 Date: 8 Oct 2002 17:40:04 -0000 Message-ID: <20021008174004.29133.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: ant-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 13413] New: - ant.bat not computing CLASSPATH correctly X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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=13413 ant.bat not computing CLASSPATH correctly Summary: ant.bat not computing CLASSPATH correctly 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: polo_talnir@hotmail.com On Windows 98, the following .bat file statement should work, but it doesn't: for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" The problem being that the buggy and not very smart MS-DOS shell of Win98SE can not compute the set ("%ANT_HOME%\lib\*.jar") because it has a full path name. There might be some settings that make this work, but these are not the default settings, at least not in our Win98SE machines here. On the other hand, if you "cd" to %ANT_HOME%\lib, and then build the set (*.jar) in the current directory, the set is built correctly. Now the problem becomes how to "cd" to this directory, build the set of jars with the full path then "cd" back. This last part is not very trivial in MS-DOS Here is a batch file segment that does that. Not very pretty, but nothing can be in MS-DOS ..., and it works: rem define the drive where Ant installation exists -- this needs to rem be computed, rather than hard-coded, from the ANT_HOME variable. rem I don't remember how to do this ... SET ANTDRIVE=C: rem getting current directory and drive letter so that I can "cd" back rem -- standard MS-DOS trick: creates a batch file that sets the WORKING_DIR rem variable to its 2nd parameter echo set WORKING_DIR=%%2> directory.bat rem -- likewise a "volume" batch file, 3rd parameter echo set DRIVELETTER=%%3> volume.bat rem -- create a batch file that invokes the "directory.bat" created above rem this uses the text produced by the "dir" command as the invocation dir | find /I "Directory of" > invoke1.bat rem -- likewise for the "volume.bat" dir | find /I "Volume in" > invoke2.bat call invoke1.bat call invoke2.bat del invoke1.bat >NUL del invoke2.bat >NUL del directory.bat >NUL del volume.bat >NUL Yes, this code creates four files to produce what in any 30-years-old UNIX shell you can do in one line, in memory: WORKING_DIR=`pwd` but I don't know of other ways to do this in MS-DOS so that it works in all Windoze OSs. This code was tested on Win2K as well. Then we can do: cd %ANT_HOME%\lib %ANTDRIVE% for %%i in ( *.jar ) do call "%ANT_HOME%\bin\lcp.bat" %ANT_HOME%\lib\%%i cd %WORKING_DIR% %DRIVELETTER%: -- To unsubscribe, e-mail: For additional commands, e-mail: