~ubuntu-branches/ubuntu/jaunty/ant/jaunty-proposed

« back to all changes in this revision

Viewing changes to src/script/ant.bat

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Gybas
  • Date: 2002-02-14 14:28:48 UTC
  • Revision ID: james.westby@ubuntu.com-20020214142848-2ww7ynmqkj31vlmn
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@echo off
 
2
 
 
3
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
 
4
 
 
5
if not "%OS%"=="Windows_NT" goto win9xStart
 
6
:winNTStart
 
7
@setlocal
 
8
 
 
9
rem %~dp0 is name of current script under NT
 
10
set DEFAULT_ANT_HOME=%~dp0
 
11
 
 
12
rem : operator works similar to make : operator
 
13
set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME%\..
 
14
 
 
15
if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
 
16
set DEFAULT_ANT_HOME=
 
17
 
 
18
rem Need to check if we are using the 4NT shell...
 
19
if "%eval[2+2]" == "4" goto setup4NT
 
20
 
 
21
rem On NT/2K grab all arguments at once
 
22
set ANT_CMD_LINE_ARGS=%*
 
23
goto doneStart
 
24
 
 
25
:setup4NT
 
26
set ANT_CMD_LINE_ARGS=%$
 
27
goto doneStart
 
28
 
 
29
:win9xStart
 
30
rem Slurp the command line arguments.  This loop allows for an unlimited number of 
 
31
rem agruments (up to the command line limit, anyway).
 
32
 
 
33
set ANT_CMD_LINE_ARGS=
 
34
 
 
35
:setupArgs
 
36
if %1a==a goto doneStart
 
37
set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
 
38
shift
 
39
goto setupArgs
 
40
 
 
41
:doneStart
 
42
rem This label provides a place for the argument list loop to break out 
 
43
rem and for NT handling to skip to.
 
44
 
 
45
rem find ANT_HOME
 
46
if not "%ANT_HOME%"=="" goto checkJava
 
47
 
 
48
rem check for ant in Program Files on system drive
 
49
if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive
 
50
set ANT_HOME=%SystemDrive%\Program Files\ant
 
51
goto checkJava
 
52
 
 
53
:checkSystemDrive
 
54
rem check for ant in root directory of system drive
 
55
if not exist %SystemDrive%\ant\nul goto checkCDrive
 
56
set ANT_HOME=%SystemDrive%\ant
 
57
goto checkJava
 
58
 
 
59
:checkCDrive
 
60
rem check for ant in C:\ant for Win9X users
 
61
if not exist C:\ant\nul goto noAntHome
 
62
set ANT_HOME=C:\ant
 
63
goto checkJava
 
64
 
 
65
:noAntHome
 
66
echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME.
 
67
goto end
 
68
 
 
69
:checkJava
 
70
set _JAVACMD=%JAVACMD%
 
71
set LOCALCLASSPATH=%CLASSPATH%
 
72
for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" %%i
 
73
 
 
74
if "%JAVA_HOME%" == "" goto noJavaHome
 
75
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java
 
76
if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat" %JAVA_HOME%\lib\tools.jar
 
77
if exist "%JAVA_HOME%\lib\classes.zip" call "%ANT_HOME%\bin\lcp.bat" %JAVA_HOME%\lib\classes.zip
 
78
goto checkJikes
 
79
 
 
80
:noJavaHome
 
81
if "%_JAVACMD%" == "" set _JAVACMD=java
 
82
echo.
 
83
echo Warning: JAVA_HOME environment variable is not set.
 
84
echo   If build fails because sun.* classes could not be found
 
85
echo   you will need to set the JAVA_HOME environment variable
 
86
echo   to the installation directory of java.
 
87
echo.
 
88
 
 
89
:checkJikes
 
90
if not "%JIKESPATH%" == "" goto runAntWithJikes
 
91
 
 
92
:runAnt
 
93
"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
 
94
goto end
 
95
 
 
96
:runAntWithJikes
 
97
"%_JAVACMD%" -classpath "%LOCALCLASSPATH%" -Dant.home="%ANT_HOME%" -Djikes.class.path="%JIKESPATH%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS%
 
98
 
 
99
:end
 
100
set LOCALCLASSPATH=
 
101
set _JAVACMD=
 
102
set ANT_CMD_LINE_ARGS=
 
103
 
 
104
if not "%OS%"=="Windows_NT" goto mainEnd
 
105
:winNTend
 
106
@endlocal
 
107
 
 
108
:mainEnd
 
109
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
 
110