bodewig 2004/04/14 08:37:04 Modified: . Tag: ANT_16_BRANCH CONTRIBUTORS WHATSNEW src/script Tag: ANT_16_BRANCH ant.cmd antenv.cmd envset.cmd runrc.cmd Log: merge Revision Changes Path No revision No revision 1.1.2.7 +1 -0 ant/CONTRIBUTORS Index: CONTRIBUTORS =================================================================== RCS file: /home/cvs/ant/CONTRIBUTORS,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- CONTRIBUTORS 13 Apr 2004 11:40:18 -0000 1.1.2.6 +++ CONTRIBUTORS 14 Apr 2004 15:37:03 -0000 1.1.2.7 @@ -190,3 +190,4 @@ Wolfgang Werner Wolf Siberski Yohann Roussel +Zdenek Wagner 1.503.2.67 +3 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.66 retrieving revision 1.503.2.67 diff -u -r1.503.2.66 -r1.503.2.67 --- WHATSNEW 13 Apr 2004 11:40:18 -0000 1.503.2.66 +++ WHATSNEW 14 Apr 2004 15:37:03 -0000 1.503.2.67 @@ -63,6 +63,9 @@ transfer and new [local|remote][File|Todir] alternatives to file and todir that explicitly state the direction of the transfer. +* The OS/2 wrapper scripts have been adapted to use the new launcher. + Bugzilla Report 28226. + Changes from Ant 1.6.0 to Ant 1.6.1 =================================== No revision No revision 1.1.2.1 +92 -71 ant/src/script/ant.cmd Index: ant.cmd =================================================================== RCS file: /home/cvs/ant/src/script/ant.cmd,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- ant.cmd 23 Apr 2003 15:57:43 -0000 1.1 +++ ant.cmd 14 Apr 2004 15:37:04 -0000 1.1.2.1 @@ -1,71 +1,92 @@ -/* - Copyright (c) 2003 The Apache Software Foundation. All rights - reserved. - - Run ant -*/ - -parse arg mode envarg '::' antarg - -if mode\='.' & mode\='..' & mode\='/' then do - envarg = mode envarg - mode = '' -end - -if antarg = '' then do - antarg = envarg - envarg = '' -end - -x = setlocal() - -env="OS2ENVIRONMENT" -antenv = _getenv_('antenv') -if _testenv_() = 0 then do - interpret 'call "' || antenv || '"' '"' || envarg || '"' - if _testenv_() = 0 then do - say 'Ant environment is not set properly' - x = endlocal() - exit 16 - end -end - -if mode = '' then mode = _getenv_('ANT_MODE' '..') -if mode \= '/' then do - runrc = _getenv_('runrc') - antrc = _getenv_('antrc' 'antrc.cmd') - if mode = '..' then mode = '-r' - else mode = '' - interpret 'call "' || runrc || '"' antrc '"' || mode || '"' -end - -settings = '-Dant.home=' || ANT_HOME '-Djava.home=' || JAVA_HOME - -java = _getenv_('javacmd' 'java') -opts = value('ANT_OPTS',,env) -args = value('ANT_ARGS',,env) -lcp = value('LOCALCLASSPATH',,env) -if lcp\='' then lcp = '-cp' lcp - -java opts lcp 'org.apache.tools.ant.Main' settings args antarg - -x = endlocal() - -return rc - -_testenv_: procedure expose env ANT_HOME JAVA_HOME -ANT_HOME = value('ANT_HOME',,env) -if ANT_HOME = '' then return 0 -JAVA_HOME = value('JAVA_HOME',,env) -if JAVA_HOME = '' then return 0 -cp = translate(value('CLASSPATH',,env)) -if pos(translate(ANT_HOME), cp) = 0 then return 0 -if pos(translate(JAVA_HOME), cp) = 0 then return 0 -return 1 - -_getenv_: procedure expose env -parse arg envar default -if default = '' then default = envar -var = value(translate(envar),,env) -if var = '' then var = default -return var +/* + Copyright 2003-2004 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Run ant +*/ + +'@echo off' +parse arg mode envarg '::' antarg + +if mode\='.' & mode\='..' & mode\='/' then do + envarg = mode envarg + mode = '' +end + +if antarg = '' then do + antarg = envarg + envarg = '' +end + +x = setlocal() + +env="OS2ENVIRONMENT" +antenv = _getenv_('antenv') +if _testenv_() = 0 then interpret 'call "' || antenv || '"' '"' || envarg || '"' + +if mode = '' then mode = _getenv_('ANT_MODE' '..') +if mode \= '/' then do + runrc = _getenv_('runrc') + antrc = _getenv_('antrc' 'antrc.cmd') + if mode = '..' then mode = '-r' + else mode = '' + interpret 'call "' || runrc || '"' antrc '"' || mode || '"' +end + +if _testenv_() = 0 then do + say 'Ant environment is not set properly' + x = endlocal() + exit 16 +end + +settings = '-Dant.home=' || ANT_HOME '-Djava.home=' || JAVA_HOME + +java = _getenv_('javacmd' 'java') +opts = value('ANT_OPTS',,env) +args = value('ANT_ARGS',,env) +lcp = value('LOCALCLASSPATH',,env) +cp = value('CLASSPATH',,env) +if value('ANT_USE_CP',,env) \= '' then do + if lcp \= '' & right(lcp, 1) \= ';' then lcp = lcp || ';' + lcp = lcp || cp + 'SET CLASSPATH=' +end +if lcp\='' then lcp = '-classpath' lcp + +cmd = java opts lcp '-jar' ANT_HOME ||'\lib\ant-launcher.jar' settings args antarg +launcher = stream(ANT_HOME ||'\lib\ant-launcher.jar', 'C', 'query exists') +if launcher = '' then entry = 'org.apache.tools.ant.Main' +else entry = 'org.apache.tools.ant.launch.Launcher' +java opts lcp entry settings args antarg + +x = endlocal() + +return rc + +_testenv_: procedure expose env ANT_HOME JAVA_HOME +ANT_HOME = value('ANT_HOME',,env) +if ANT_HOME = '' then return 0 +JAVA_HOME = value('JAVA_HOME',,env) +if JAVA_HOME = '' then return 0 +cp = translate(value('CLASSPATH',,env)) +if pos(translate(ANT_HOME), cp) = 0 then return 0 +if pos(translate(JAVA_HOME), cp) = 0 then return 0 +return 1 + +_getenv_: procedure expose env +parse arg envar default +if default = '' then default = envar +var = value(translate(envar),,env) +if var = '' then var = default +return var 1.1.2.1 +99 -100 ant/src/script/antenv.cmd Index: antenv.cmd =================================================================== RCS file: /home/cvs/ant/src/script/antenv.cmd,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- antenv.cmd 23 Apr 2003 15:57:43 -0000 1.1 +++ antenv.cmd 14 Apr 2004 15:37:04 -0000 1.1.2.1 @@ -1,100 +1,99 @@ -/* - Copyright (c) 2003 The Apache Software Foundation. All rights - reserved. - - Ant environment -*/ - -call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs" -call SysLoadFuncs - -/* Prepare the parameters for later use */ -parse arg argv -mode = '' -args = '' -opts = '' -cp = '' -lcp = '' - -do i = 1 to words(argv) - param = word(argv, i) - select - when param='-lcp' then mode = 'l' - when param='-cp' | param='-classpath' then mode = 'c' - when abbrev('-opts', param, 4) then mode = 'o' - when abbrev('-args', param, 4) then mode = 'a' - otherwise - select - when mode = 'a' then args = space(args param, 1) - when mode = 'c' then cp = space(cp param, 1) - when mode = 'l' then lcp = space(lcp param, 1) - when mode = 'o' then opts = space(opts param, 1) - otherwise - say 'Option' param 'ignored' - end - end -end - -env="OS2ENVIRONMENT" -antconf = _getenv_('antconf' 'antconf.cmd') -runrc = _getenv_('runrc') -interpret 'call "' || runrc || '"' '"' || antconf || '"' 'ETC' -ANT_HOME = value('ANT_HOME',,env) -JAVA_HOME = value('JAVA_HOME',,env) -classpath = value('CLASSPATH',,env) -classes = stream(JAVA_HOME || "\lib\classes.zip", "C", "QUERY EXISTS") -if classes \= '' then classpath = prepend(classpath classes) -classes = stream(JAVA_HOME || "\lib\tools.jar", "C", "QUERY EXISTS") -if classes \= '' then classpath = prepend(classpath classes) - -mincp = classpath -call SysFileTree ANT_HOME || '\lib\*.jar', 'jar', 'FO' -do i = 1 to jar.0 - nm = filespec('name', jar.i) - if pos('ant-', nm) == 0 then classpath = prepend(classpath jar.i) -end -if length(classpath) > 512 then do - say 'Classpath is too long, switching to the minimal version...' - say '... some tasks will not work' - classpath = mincp - classpath = prepend(classpath ANT_HOME || '\lib\ant.jar') - classpath = prepend(classpath ANT_HOME || '\lib\optional.jar') -end - -'SET CLASSPATH=' || classpath - -/* Setting classpathes, options and arguments */ -envset = _getenv_('envset') -if cp\='' then interpret 'call "' || envset || '"' '"; CLASSPATH"' '"' || cp || '"' -if lcp\='' then interpret 'call "' || envset || '"' '"; LOCALCLASSPATH"' '"' || lcp || '"' -if opts\='' then interpret 'call "' || envset || '"' '"-D ANT_OPTS"' '"' || opts || '"' -if args\='' then interpret 'call "' || envset || '"' '"ANT_ARGS"' '"' || args || '"' - -exit 0 - -addpath: procedure -parse arg path elem -if elem = '' then do - if path\='' & right(path, 1)\=';' then path = path || ';' - return path -end -if substr(path, length(path)) = ';' then glue = '' -else glue = ';' -if pos(translate(elem), translate(path)) = 0 then path = path || glue || elem || ';' -return path - -prepend: procedure -parse arg path elem -if elem = '' then do - if path\='' & right(path, 1)\=';' then path = path || ';' - return path -end -if pos(translate(elem), translate(path)) = 0 then path = elem || ';' || path -return path - -_getenv_: procedure expose env -parse arg envar default -if default = '' then default = envar -var = value(translate(envar),,env) -if var = '' then var = default -return var +/* + Copyright 2003-2004 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ant environment +*/ + +'@echo off' +call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs" +call SysLoadFuncs + +/* Prepare the parameters for later use */ +parse arg argv +mode = '' +args = '' +opts = '' +cp = '' +lcp = '' + +do i = 1 to words(argv) + param = word(argv, i) + select + when param='-lcp' then mode = 'l' + when param='-cp' | param='-classpath' then mode = 'c' + when abbrev('-opts', param, 4) then mode = 'o' + when abbrev('-args', param, 4) then mode = 'a' + otherwise + select + when mode = 'a' then args = space(args param, 1) + when mode = 'c' then cp = space(cp param, 1) + when mode = 'l' then lcp = space(lcp param, 1) + when mode = 'o' then opts = space(opts param, 1) + otherwise + say 'Option' param 'ignored' + end + end +end + +env="OS2ENVIRONMENT" +antconf = _getenv_('antconf' 'antconf.cmd') +runrc = _getenv_('runrc') +interpret 'call "' || runrc || '"' '"' || antconf || '"' 'ETC' +ANT_HOME = value('ANT_HOME',,env) +JAVA_HOME = value('JAVA_HOME',,env) +classpath = value('CLASSPATH',,env) +classes = stream(JAVA_HOME || "\lib\classes.zip", "C", "QUERY EXISTS") +if classes \= '' then classpath = prepend(classpath classes) +classes = stream(JAVA_HOME || "\lib\tools.jar", "C", "QUERY EXISTS") +if classes \= '' then classpath = prepend(classpath classes) + +classpath = prepend(classpath ANT_HOME || '\lib\ant-launcher.jar') +'SET CLASSPATH=' || classpath + +/* Setting classpathes, options and arguments */ +envset = _getenv_('envset') +if cp\='' then interpret 'call "' || envset || '"' '"; CLASSPATH"' '"' || cp || '"' +if lcp\='' then interpret 'call "' || envset || '"' '"; LOCALCLASSPATH"' '"' || lcp || '"' +if opts\='' then interpret 'call "' || envset || '"' '"-D ANT_OPTS"' '"' || opts || '"' +if args\='' then interpret 'call "' || envset || '"' '"ANT_ARGS"' '"' || args || '"' + +exit 0 + +addpath: procedure +parse arg path elem +if elem = '' then do + if path\='' & right(path, 1)\=';' then path = path || ';' + return path +end +if substr(path, length(path)) = ';' then glue = '' +else glue = ';' +if pos(translate(elem), translate(path)) = 0 then path = path || glue || elem || ';' +return path + +prepend: procedure +parse arg path elem +if elem = '' then do + if path\='' & right(path, 1)\=';' then path = path || ';' + return path +end +if pos(translate(elem), translate(path)) = 0 then path = elem || ';' || path +return path + +_getenv_: procedure expose env +parse arg envar default +if default = '' then default = envar +var = value(translate(envar),,env) +if var = '' then var = default +return var 1.1.2.1 +130 -119 ant/src/script/envset.cmd Index: envset.cmd =================================================================== RCS file: /home/cvs/ant/src/script/envset.cmd,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- envset.cmd 23 Apr 2003 15:57:43 -0000 1.1 +++ envset.cmd 14 Apr 2004 15:37:04 -0000 1.1.2.1 @@ -1,119 +1,130 @@ -/* - - Copyright (c) 2003 The Apache Software Foundation. All rights - reserved. - -SET environment variables -First optional parameter: - ; parameters are considered parts of a path variable, semicolons are - appended to each element if not already present - -D parameters are properties for Java or Makefile etc., -D will be - prepended and the parameters will be separated by a space - =D the same as above but equal sign is not required - , parameters should be comma separated in the environment variable - - parameters should be separated by the next parameter - Other values mean that the first parameter is missing and the environment - variable will be set to the space separated parameters - -Second parameter: name of the environment variable - -Next parameters: values -; implies that the equal sign is considered a part of the parameter and is -not interpreted - --D requires parameters in the form name=value. If the equal sign is not found, -the parameters are changed to name=expanded_name - -Other options have optional equal sign. If it is found, only the part after -the equal sign will be oprionally expanded. - -If the parameter is the minus sign, the next parameter will not be expanded. -If the parameter is a single dot, it will be replaced with the value of the -environment variable as it existed before envset was invoked. - -For other parameters the batch looks for the environment variable with the -same name (in uppercase). If it is found, it forms the expanded_name. If -the environment variable with such a name does not exist, the expanded_name -will hold the parameter name without case conversion. -*/ - -parse arg mode envar args - -equal = 0 -sep = ' ' - -/* Parse command line parameters */ -select - when mode='-' then do - sep = envar - parse var args envar args - end - when mode=';' then do - sep = '' - equal = -1 - end - when mode='-D' then equal = 1 - when mode='=D' then mode = '-D' - when mode=',' then sep = ',' -otherwise - args = envar args - envar = mode - mode = '' -end - -env = 'OS2ENVIRONMENT' -envar = translate(envar) -orig = value(envar,,env) -newval = '' -expand = 1 - -/* for each parameter... */ -do i = 1 to words(args) - if expand > 0 & word(args, i) = '-' then expand = 0 - else call addval word(args, i) -end - -/* Optionally enclose path variable by quotes */ -if mode = ';' & pos(' ', newval) > 0 then newval = '"' || newval || '"' - -/* Set the new value, 'SET' cannot be used since it does not allow '=' */ -x = value(envar, newval, env) -exit 0 - -addval: procedure expose sep equal orig expand newval mode env -parse arg var - -if var = '.' then expvar = orig -else do - if equal >= 0 then do - parse var var name '=' val - if val = '' then var = name - else var = val - end - if expand = 0 then expvar = var - else expvar = value(translate(var),,env) - if expvar = '' then expvar = var - if equal >= 0 then do - if val = '' then do - parse var expvar key '=' val - if val <> '' then name = key - else do - if equal > 0 then val = key - else name = key - end - end - else val = expvar - if pos(' ', val) > 0 | pos('=', val) > 0 then val = '"' || val || '"' - if val = '' then expvar = name - else expvar = name || '=' || val - end - if mode = '-D' then expvar = '-D' || expvar - if mode = ';' then do - if right(expvar, 1) <> ';' then expvar = expvar || ';' - end -end - -if newval = '' then newval = expvar -else newval = newval || sep || expvar -expand = 1 -return +/* + + Copyright 2003-2004 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +SET environment variables +First optional parameter: + ; parameters are considered parts of a path variable, semicolons are + appended to each element if not already present + -D parameters are properties for Java or Makefile etc., -D will be + prepended and the parameters will be separated by a space + =D the same as above but equal sign is not required + , parameters should be comma separated in the environment variable + - parameters should be separated by the next parameter + Other values mean that the first parameter is missing and the environment + variable will be set to the space separated parameters + +Second parameter: name of the environment variable + +Next parameters: values +; implies that the equal sign is considered a part of the parameter and is +not interpreted + +-D requires parameters in the form name=value. If the equal sign is not found, +the parameters are changed to name=expanded_name + +Other options have optional equal sign. If it is found, only the part after +the equal sign will be oprionally expanded. + +If the parameter is the minus sign, the next parameter will not be expanded. +If the parameter is a single dot, it will be replaced with the value of the +environment variable as it existed before envset was invoked. + +For other parameters the batch looks for the environment variable with the +same name (in uppercase). If it is found, it forms the expanded_name. If +the environment variable with such a name does not exist, the expanded_name +will hold the parameter name without case conversion. +*/ + +parse arg mode envar args + +equal = 0 +sep = ' ' + +/* Parse command line parameters */ +select + when mode='-' then do + sep = envar + parse var args envar args + end + when mode=';' then do + sep = '' + equal = -1 + end + when mode='-D' then equal = 1 + when mode='=D' then mode = '-D' + when mode=',' then sep = ',' +otherwise + args = envar args + envar = mode + mode = '' +end + +env = 'OS2ENVIRONMENT' +envar = translate(envar) +orig = value(envar,,env) +newval = '' +expand = 1 + +/* for each parameter... */ +do i = 1 to words(args) + if expand > 0 & word(args, i) = '-' then expand = 0 + else call addval word(args, i) +end + +/* Optionally enclose path variable by quotes */ +if mode = ';' & pos(' ', newval) > 0 then newval = '"' || newval || '"' + +/* Set the new value, 'SET' cannot be used since it does not allow '=' */ +x = value(envar, newval, env) +exit 0 + +addval: procedure expose sep equal orig expand newval mode env +parse arg var + +if var = '.' then expvar = orig +else do + if equal >= 0 then do + parse var var name '=' val + if val = '' then var = name + else var = val + end + if expand = 0 then expvar = var + else expvar = value(translate(var),,env) + if expvar = '' then expvar = var + if equal >= 0 then do + if val = '' then do + parse var expvar key '=' val + if val <> '' then name = key + else do + if equal > 0 then val = key + else name = key + end + end + else val = expvar + if pos(' ', val) > 0 | pos('=', val) > 0 then val = '"' || val || '"' + if val = '' then expvar = name + else expvar = name || '=' || val + end + if mode = '-D' then expvar = '-D' || expvar + if mode = ';' then do + if right(expvar, 1) <> ';' then expvar = expvar || ';' + end +end + +if newval = '' then newval = expvar +else newval = newval || sep || expvar +expand = 1 +return 1.1.2.1 +59 -48 ant/src/script/runrc.cmd Index: runrc.cmd =================================================================== RCS file: /home/cvs/ant/src/script/runrc.cmd,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- runrc.cmd 23 Apr 2003 15:57:43 -0000 1.1 +++ runrc.cmd 14 Apr 2004 15:37:04 -0000 1.1.2.1 @@ -1,48 +1,59 @@ -/* - Copyright (c) 2003 The Apache Software Foundation. All rights - reserved. - - Run RC file, name is in the first arg, second arg is either PATH - ENV or -r or nothing -*/ - -parse arg name path rest - -if name = '' then do - say 'RC file name is missing' - exit 1 -end - -if rest \= '' then do - say 'Too many parameters' - exit 1 -end - -call runit name path -exit 0 - -runit: procedure -parse arg name path dir - -if path \= '' & path \= '-r' then do - dir = value(translate(path),,'OS2ENVIRONMENT') - if dir = '' then return - dir = translate(dir, '\', '/') /* change UNIX-like path to OS/2 */ -end - -if dir = '' then dir = directory() - -if path = '-r' then do /* recursive call */ - subdir = filespec('path', dir) - if subdir \= '\' then do - subdir = left(subdir, length(subdir)-1) - call runit name path filespec('drive', dir) || subdir - end -end - -/* Look for the file and run it */ -if right(dir, 1) \= '\' then dir = dir || '\' -rcfile = stream(dir || name, 'c', 'query exists') -if rcfile \= '' then interpret 'call "' || rcfile || '"' - -return +/* + Copyright 2003-2004 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Run RC file, name is in the first arg, second arg is either PATH + ENV or -r or nothing +*/ + +parse arg name path rest + +if name = '' then do + say 'RC file name is missing' + exit 1 +end + +if rest \= '' then do + say 'Too many parameters' + exit 1 +end + +call runit name path +exit 0 + +runit: procedure +parse arg name path dir + +if path \= '' & path \= '-r' then do + dir = value(translate(path),,'OS2ENVIRONMENT') + if dir = '' then return + dir = translate(dir, '\', '/') /* change UNIX-like path to OS/2 */ +end + +if dir = '' then dir = directory() + +if path = '-r' then do /* recursive call */ + subdir = filespec('path', dir) + if subdir \= '\' then do + subdir = left(subdir, length(subdir)-1) + call runit name path filespec('drive', dir) || subdir + end +end + +/* Look for the file and run it */ +if right(dir, 1) \= '\' then dir = dir || '\' +rcfile = stream(dir || name, 'c', 'query exists') +if rcfile \= '' then interpret 'call "' || rcfile || '"' + +return
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]