source: release-kits/lirk3/bin/apache-ant-1.6.5/bootstrap/bin/ant.cmd@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 2.6 KB
Line 
1/*
2 Copyright 2003-2004 The Apache Software Foundation
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 Run ant
17*/
18
19'@echo off'
20parse arg mode envarg '::' antarg
21
22if mode\='.' & mode\='..' & mode\='/' then do
23 envarg = mode envarg
24 mode = ''
25end
26
27if antarg = '' then do
28 antarg = envarg
29 envarg = ''
30end
31
32x = setlocal()
33
34env="OS2ENVIRONMENT"
35antenv = _getenv_('antenv')
36if _testenv_() = 0 then interpret 'call "' || antenv || '"' '"' || envarg || '"'
37
38if mode = '' then mode = _getenv_('ANT_MODE' '..')
39if mode \= '/' then do
40 runrc = _getenv_('runrc')
41 antrc = _getenv_('antrc' 'antrc.cmd')
42 if mode = '..' then mode = '-r'
43 else mode = ''
44 interpret 'call "' || runrc || '"' antrc '"' || mode || '"'
45end
46
47if _testenv_() = 0 then do
48 say 'Ant environment is not set properly'
49 x = endlocal()
50 exit 16
51end
52
53settings = '-Dant.home=' || ANT_HOME '-Djava.home=' || JAVA_HOME
54
55java = _getenv_('javacmd' 'java')
56opts = value('ANT_OPTS',,env)
57args = value('ANT_ARGS',,env)
58lcp = value('LOCALCLASSPATH',,env)
59cp = value('CLASSPATH',,env)
60if value('ANT_USE_CP',,env) \= '' then do
61 if lcp \= '' & right(lcp, 1) \= ';' then lcp = lcp || ';'
62 lcp = lcp || cp
63 'SET CLASSPATH='
64end
65if lcp\='' then lcp = '-classpath' lcp
66
67cmd = java opts lcp '-jar' ANT_HOME ||'\lib\ant-launcher.jar' settings args antarg
68launcher = stream(ANT_HOME ||'\lib\ant-launcher.jar', 'C', 'query exists')
69if launcher = '' then entry = 'org.apache.tools.ant.Main'
70else entry = 'org.apache.tools.ant.launch.Launcher'
71java opts lcp entry settings args antarg
72
73x = endlocal()
74
75return rc
76
77_testenv_: procedure expose env ANT_HOME JAVA_HOME
78ANT_HOME = value('ANT_HOME',,env)
79if ANT_HOME = '' then return 0
80JAVA_HOME = value('JAVA_HOME',,env)
81if JAVA_HOME = '' then return 0
82cp = translate(value('CLASSPATH',,env))
83if pos(translate(ANT_HOME), cp) = 0 then return 0
84if pos(translate(JAVA_HOME), cp) = 0 then return 0
85return 1
86
87_getenv_: procedure expose env
88parse arg envar default
89if default = '' then default = envar
90var = value(translate(envar),,env)
91if var = '' then var = default
92return var
Note: See TracBrowser for help on using the repository browser.