source: other-projects/trunk/gs3-release-maker/apache-ant-1.6.5/bootstrap/bin/antenv.cmd@ 14627

Last change on this file since 14627 was 14627, checked in by oranfry, 17 years ago

initial import of the gs3-release-maker

File size: 3.2 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 Ant environment
17*/
18
19'@echo off'
20call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
21call SysLoadFuncs
22
23/* Prepare the parameters for later use */
24parse arg argv
25mode = ''
26args = ''
27opts = ''
28cp = ''
29lcp = ''
30
31do i = 1 to words(argv)
32 param = word(argv, i)
33 select
34 when param='-lcp' then mode = 'l'
35 when param='-cp' | param='-classpath' then mode = 'c'
36 when abbrev('-opts', param, 4) then mode = 'o'
37 when abbrev('-args', param, 4) then mode = 'a'
38 otherwise
39 select
40 when mode = 'a' then args = space(args param, 1)
41 when mode = 'c' then cp = space(cp param, 1)
42 when mode = 'l' then lcp = space(lcp param, 1)
43 when mode = 'o' then opts = space(opts param, 1)
44 otherwise
45 say 'Option' param 'ignored'
46 end
47 end
48end
49
50env="OS2ENVIRONMENT"
51antconf = _getenv_('antconf' 'antconf.cmd')
52runrc = _getenv_('runrc')
53interpret 'call "' || runrc || '"' '"' || antconf || '"' 'ETC'
54ANT_HOME = value('ANT_HOME',,env)
55JAVA_HOME = value('JAVA_HOME',,env)
56classpath = value('CLASSPATH',,env)
57classes = stream(JAVA_HOME || "\lib\classes.zip", "C", "QUERY EXISTS")
58if classes \= '' then classpath = prepend(classpath classes)
59classes = stream(JAVA_HOME || "\lib\tools.jar", "C", "QUERY EXISTS")
60if classes \= '' then classpath = prepend(classpath classes)
61
62classpath = prepend(classpath ANT_HOME || '\lib\ant-launcher.jar')
63'SET CLASSPATH=' || classpath
64
65/* Setting classpathes, options and arguments */
66envset = _getenv_('envset')
67if cp\='' then interpret 'call "' || envset || '"' '"; CLASSPATH"' '"' || cp || '"'
68if lcp\='' then interpret 'call "' || envset || '"' '"; LOCALCLASSPATH"' '"' || lcp || '"'
69if opts\='' then interpret 'call "' || envset || '"' '"-D ANT_OPTS"' '"' || opts || '"'
70if args\='' then interpret 'call "' || envset || '"' '"ANT_ARGS"' '"' || args || '"'
71
72exit 0
73
74addpath: procedure
75parse arg path elem
76if elem = '' then do
77 if path\='' & right(path, 1)\=';' then path = path || ';'
78 return path
79end
80if substr(path, length(path)) = ';' then glue = ''
81else glue = ';'
82if pos(translate(elem), translate(path)) = 0 then path = path || glue || elem || ';'
83return path
84
85prepend: procedure
86parse arg path elem
87if elem = '' then do
88 if path\='' & right(path, 1)\=';' then path = path || ';'
89 return path
90end
91if pos(translate(elem), translate(path)) = 0 then path = elem || ';' || path
92return path
93
94_getenv_: procedure expose env
95parse arg envar default
96if default = '' then default = envar
97var = value(translate(envar),,env)
98if var = '' then var = default
99return var
Note: See TracBrowser for help on using the repository browser.