Browse Source

Use /nul when checkign for the existence of directories on Windows

(Although it doesn't work if the directory name is quoted - woohoo)
Check for Ant in C:\Ant for Windows 9X users

PR:	2101
Based on suggestion by eswierk@cs.stanford.edu (Ed Swierk)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269331 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 24 years ago
parent
commit
e49a5fb564
2 changed files with 14 additions and 8 deletions
  1. +7
    -7
      bootstrap.bat
  2. +7
    -1
      src/script/ant.bat

+ 7
- 7
bootstrap.bat View File

@@ -18,10 +18,10 @@ if "" == "%JAVAC%" set JAVAC=%JAVA_HOME%\bin\javac
echo.
echo ... Bootstrapping Ant Distribution

if "%OS%" == "Windows_NT" if exist bootstrap rmdir/s/q bootstrap
if not "%OS%" == "Windows_NT" if exist bootstrap deltree/y bootstrap
if "%OS%" == "Windows_NT" if exist build\classes rmdir/s/q build\classes
if not "%OS%" == "Windows_NT" if exist build\classes deltree/y build\classes
if "%OS%" == "Windows_NT" if exist bootstrap\nul rmdir/s/q bootstrap
if not "%OS%" == "Windows_NT" if exist bootstrap\nul deltree/y bootstrap
if "%OS%" == "Windows_NT" if exist build\classes\nul rmdir/s/q build\classes
if not "%OS%" == "Windows_NT" if exist build\classes\nul deltree/y build\classes

SET LOCALCLASSPATH=lib\crimson.jar;lib\jaxp.jar;lib\optional\junit.jar

@@ -41,9 +41,9 @@ echo CLASSPATH=%CLASSPATH%
if "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul rmdir/s/q %CLASSDIR%
if not "%OS%" == "Windows_NT" if exist %CLASSDIR%\nul deltree/y %CLASSDIR%

if not exist %CLASSDIR% mkdir %CLASSDIR%
if not exist build mkdir build
if not exist build\classes mkdir build\classes
if not exist %CLASSDIR%\nul mkdir %CLASSDIR%
if not exist build\nul mkdir build
if not exist build\classes\nul mkdir build\classes

echo.
echo ... Compiling Ant Classes


+ 7
- 1
src/script/ant.bat View File

@@ -52,10 +52,16 @@ goto checkJava

:checkSystemDrive
rem check for ant in root directory of system drive
if not exist "%SystemDrive%\ant" goto noAntHome
if not exist %SystemDrive%\ant\nul goto checkCDrive
set ANT_HOME=%SystemDrive%\ant
goto checkJava

:checkCDrive
rem check for ant in C:\ant for Win9X users
if not exist C:\ant\nul goto noAntHome
set ANT_HOME=C:\ant
goto checkJava

:noAntHome
echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME.
goto end


Loading…
Cancel
Save