Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ant.cmd 2.5KB

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