Blame | Last modification | View Log | RSS feed
/*Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements. See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License.Run ant*/'@echo off'parse arg mode envarg '::' antargif mode\='.' & mode\='..' & mode\='/' then doenvarg = mode envargmode = ''endif antarg = '' then doantarg = envargenvarg = ''endx = setlocal()env="OS2ENVIRONMENT"antenv = _getenv_('antenv')if _testenv_() = 0 then interpret 'call "' || antenv || '"' '"' || envarg || '"'if mode = '' then mode = _getenv_('ANT_MODE' '..')if mode \= '/' then dorunrc = _getenv_('runrc')antrc = _getenv_('antrc' 'antrc.cmd')if mode = '..' then mode = '-r'else mode = ''interpret 'call "' || runrc || '"' antrc '"' || mode || '"'endif _testenv_() = 0 then dosay 'Ant environment is not set properly'x = endlocal()exit 16endsettings = '-Dant.home=' || ANT_HOME '-Djava.home=' || JAVA_HOMEjava = _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 doif lcp \= '' & right(lcp, 1) \= ';' then lcp = lcp || ';'lcp = lcp || cp'SET CLASSPATH='endif lcp\='' then lcp = '-classpath' lcpcmd = java opts lcp '-jar' ANT_HOME ||'\lib\ant-launcher.jar' settings args antarglauncher = 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 antargx = endlocal()return rc_testenv_: procedure expose env ANT_HOME JAVA_HOMEANT_HOME = value('ANT_HOME',,env)if ANT_HOME = '' then return 0JAVA_HOME = value('JAVA_HOME',,env)if JAVA_HOME = '' then return 0cp = translate(value('CLASSPATH',,env))if pos(translate(ANT_HOME), cp) = 0 then return 0if pos(translate(JAVA_HOME), cp) = 0 then return 0return 1_getenv_: procedure expose envparse arg envar defaultif default = '' then default = envarvar = value(translate(envar),,env)if var = '' then var = defaultreturn var