ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Louis Tribble <louis.trib...@metamata.com>
Subject Re: Default libs included
Date Thu, 14 Dec 2000 18:39:08 GMT
Peter Donald wrote:
> 
> Hi,
> 
> I have just gone through and updated a number of projects to use latest CVS
> ant and realized that ant is almost ready to be deployed once per machine
> rather than once per project. The few things that stop it are;
> 
> 1. $ANT_HOME has to be set due to limitations of win9x ;(
> 2. lib dirs other than $ANT_HOME/lib should ideally auotmagically sucked
> into classpath
> 
> I think we can fix 2 by an addition to the scripts. Basically suck in all
> jars in ./lib just like we do for $ANT_HOME/lib. This is likeable because
> it is very common pattern among different projects. 

I don't think the patch posted by Vincent Bergbauer ever got applied.
It seems to solve 1 for NT/2K. I've appended his message. (I haven't
used it yet, but I've been saving it.)

Louis
-- 
 Subject: 
   Patch: Making ANT_HOME easier to find on WinNT/2000
    Date: Tue, 17 Oct 2000 14:08:37 -0500
    From: "Vincent Bergbauer" <vincent_bergbauer@yahoo.com>
Reply-To: ant-dev@jakarta.apache.org
      To: <ant-dev@jakarta.apache.org>

ant.bat tries to guess where Ant's directory is.
On Windows NT/2000, you can use %~dp0 to find the path of a batch file.
This takes the guess work out of finding ANT_HOME.
Since this is a feature of the Windows NT/2000 command shell, I first check
if "%OS%"=="Windows_NT", which is true for all versions of WinNT/2000.

All we need is to add the following lines at the beginning of the ant.bat file (before the

command line argument "slurping" (I also attached a 'diff -u'):

rem When using Windows NT (or W2K), the path of the batch file
rem (and therefore ANT_HOME) can be determined.
if not "%OS%"=="Windows_NT" goto start
set DEFAULT_ANT_HOME=%~dp0
set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME:\bin\=%
if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
set DEFAULT_ANT_HOME=

:start

I tested this on Windows 2000sp1 both under DOS and Cygwin.
Cheers.
Vincent.

Mime
View raw message