You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2004/10/24 18:42:21 UTC

svn commit: rev 55450 - in incubator/lenya/trunk: . lib src/targets tools/bin tools/lib

Author: gregor
Date: Sun Oct 24 09:42:21 2004
New Revision: 55450

Added:
   incubator/lenya/trunk/build.bat
   incubator/lenya/trunk/build.sh
   incubator/lenya/trunk/lib/xercesImpl-2.6.2.jar   (contents, props changed)
   incubator/lenya/trunk/lib/xml-apis.jar   (contents, props changed)
   incubator/lenya/trunk/tools/bin/ant
   incubator/lenya/trunk/tools/bin/ant.bat
   incubator/lenya/trunk/tools/bin/ant.cmd
   incubator/lenya/trunk/tools/bin/antRun
   incubator/lenya/trunk/tools/bin/antRun.bat
   incubator/lenya/trunk/tools/bin/antRun.pl
   incubator/lenya/trunk/tools/bin/antenv.cmd
   incubator/lenya/trunk/tools/bin/appendcp.bat
   incubator/lenya/trunk/tools/bin/complete-ant-cmd.pl
   incubator/lenya/trunk/tools/bin/create-repository-jars.sh
   incubator/lenya/trunk/tools/bin/envset.cmd
   incubator/lenya/trunk/tools/bin/lcp.bat
   incubator/lenya/trunk/tools/bin/runant.pl
   incubator/lenya/trunk/tools/bin/runant.py
   incubator/lenya/trunk/tools/bin/runrc.cmd
   incubator/lenya/trunk/tools/lib/ant-contrib-0.6.jar   (contents, props changed)
   incubator/lenya/trunk/tools/lib/ant-junit.jar   (contents, props changed)
   incubator/lenya/trunk/tools/lib/ant-launcher.jar   (contents, props changed)
   incubator/lenya/trunk/tools/lib/ant-trax.jar   (contents, props changed)
   incubator/lenya/trunk/tools/lib/ant.jar   (contents, props changed)
Removed:
   incubator/lenya/trunk/build.properties.sample
   incubator/lenya/trunk/gump.xml
   incubator/lenya/trunk/lib/ant-1.6a-2003-08-05.jar
   incubator/lenya/trunk/lib/ant-optional1.6a-2003-08-05.jar
   incubator/lenya/trunk/lib/commons-dbcp.jar
   incubator/lenya/trunk/src/targets/init-build.xml
   incubator/lenya/trunk/src/targets/properties-build.xml
   incubator/lenya/trunk/src/targets/webapp-build.xml
Log:
overhaul of the build system:

got rid of duplicate servlet.jar
switched to standard build.properties / local.build.properties pair
removed dependency on external ant
added build.bat / build.sh script from cocoon
got rid of commons-dpcp.jar
Tomcat 5 is now the default
Upgraded Ant from 1.6a to 1.6.2
removed gump.xml (it is managed externally now)



Added: incubator/lenya/trunk/build.bat
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/build.bat	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,39 @@
+@echo off
+rem  Copyright 1999-2004 The Apache Software Foundation
+rem
+rem  Licensed under the Apache License, Version 2.0 (the "License");
+rem  you may not use this file except in compliance with the License.
+rem  You may obtain a copy of the License at
+rem
+rem      http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem  Unless required by applicable law or agreed to in writing, software
+rem  distributed under the License is distributed on an "AS IS" BASIS,
+rem  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem  See the License for the specific language governing permissions and
+rem  limitations under the License.
+rem
+rem ----------------------------------------------------------------------------
+rem build.bat - Win32 Build Script for Apache Lenya
+rem
+rem $Id: build.bat 54525 2004-10-11 09:39:04Z cziegeler $
+rem ----------------------------------------------------------------------------
+
+rem ----- Ignore system CLASSPATH variable
+set OLD_CLASSPATH=%CLASSPATH%
+set CLASSPATH=
+for %%i in (lib\*.jar) do call tools\bin\appendcp.bat %%i
+
+rem ----- Use Ant shipped with Cocoon. Ignore installed in the system Ant
+set OLD_ANT_HOME=%ANT_HOME%
+set ANT_HOME=tools
+
+call %ANT_HOME%\bin\ant -Djava.endorsed.dirs=lib\endorsed -logger org.apache.tools.ant.NoBannerLogger -emacs %1 %2 %3 %4 %5 %6 %7 %8 %9
+
+rem ----- Restore ANT_HOME and ANT_OPTS
+set ANT_HOME=%OLD_ANT_HOME%
+set OLD_ANT_HOME=
+
+rem ----- Restore CLASSPATH
+set CLASSPATH=%OLD_CLASSPATH%
+set OLD_CLASSPATH=

Added: incubator/lenya/trunk/build.sh
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/build.sh	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+#  Copyright 1999-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.
+
+chmod u+x ./tools/bin/antRun
+chmod u+x ./tools/bin/ant
+
+# ----- Verify and Set Required Environment Variables -------------------------
+
+if [ "$TERM" = "cygwin" ] ; then
+  S=';'
+else
+  S=':'
+fi
+
+# ----- Ignore system CLASSPATH variable
+OLD_CLASSPATH="$CLASSPATH"
+unset CLASSPATH
+CLASSPATH="`echo lib/*.jar | tr ' ' $S`"
+export CLASSPATH
+
+# ----- Use Ant shipped with Lenya. Ignore installed in the system Ant
+OLD_ANT_HOME="$ANT_HOME"
+ANT_HOME=tools
+OLD_ANT_OPTS="$ANT_OPTS"
+ANT_OPTS="-Xms32M -Xmx512M -Djava.endorsed.dirs=lib/endorsed"
+export ANT_HOME ANT_OPTS
+
+"$ANT_HOME/bin/ant" -logger org.apache.tools.ant.NoBannerLogger -emacs  $@
+
+# ----- Restore ANT_HOME and ANT_OPTS
+ANT_HOME="$OLD_ANT_HOME"
+ANT_OPTS="$OLD_ANT_OPTS"
+export ANT_HOME ANT_OPTS
+unset OLD_ANT_HOME
+unset OLD_ANT_OPTS
+
+# ----- Restore CLASSPATH
+CLASSPATH="$OLD_CLASSPATH"
+export CLASSPATH
+unset OLD_CLASSPATH

Added: incubator/lenya/trunk/lib/xercesImpl-2.6.2.jar
==============================================================================
Binary file. No diff available.

Added: incubator/lenya/trunk/lib/xml-apis.jar
==============================================================================
Binary file. No diff available.

Added: incubator/lenya/trunk/tools/bin/ant
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/ant	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,302 @@
+#! /bin/sh
+
+#   Copyright 2001-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.
+
+# Extract launch and ant arguments, (see details below).
+ant_exec_args=
+no_config=false
+use_jikes_default=false
+ant_exec_debug=false
+show_help=false
+for arg in "$@" ; do
+  if [ "$arg" = "--noconfig" ] ; then
+    no_config=true
+  elif [ "$arg" = "--usejikes" ] ; then
+    use_jikes_default=true
+  elif [ "$arg" = "--execdebug" ] ; then
+    ant_exec_debug=true
+  elif [ my"$arg" = my"--h"  -o my"$arg" = my"--help"  ] ; then
+    show_help=true
+    ant_exec_args="$ant_exec_args -h"
+  else
+    if [  my"$arg" = my"-h"  -o  my"$arg" = my"-help" ] ; then
+      show_help=true
+    fi
+    ant_exec_args="$ant_exec_args \"$arg\""
+  fi
+done
+
+# Source/default ant configuration
+if $no_config ; then
+  rpm_mode=false
+  usejikes=$use_jikes_default
+else
+  # load system-wide ant configuration
+  if [ -f "/etc/ant.conf" ] ; then
+    . /etc/ant.conf
+  fi
+
+  # load user ant configuration
+  if [ -f "$HOME/.ant/ant.conf" ] ; then
+    . $HOME/.ant/ant.conf
+  fi
+  if [ -f "$HOME/.antrc" ] ; then
+    . "$HOME/.antrc"
+  fi
+
+  # provide default configuration values
+  if [ -z "$rpm_mode" ] ; then
+    rpm_mode=false
+  fi
+  if [ -z "$usejikes" ] ; then
+    usejikes=$use_jikes_default
+  fi
+fi
+
+# Setup Java environment in rpm mode
+if $rpm_mode ; then
+  if [ -f /usr/share/java-utils/java-functions ] ; then
+    . /usr/share/java-utils/java-functions
+    set_jvm
+    set_javacmd
+  fi
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  Darwin*) darwin=true
+           if [ -z "$JAVA_HOME" ] ; then
+             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+           fi
+           ;;
+esac
+
+if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then
+  # try to find ANT
+  if [ -d /opt/ant ] ; then
+    ANT_HOME=/opt/ant
+  fi
+
+  if [ -d "${HOME}/opt/ant" ] ; then
+    ANT_HOME="${HOME}/opt/ant"
+  fi
+
+  ## resolve links - $0 may be a link to ant's home
+  PRG="$0"
+  progname=`basename "$0"`
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+    else
+    PRG=`dirname "$PRG"`"/$link"
+    fi
+  done
+
+  ANT_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  ANT_HOME=`cd "$ANT_HOME" && pwd`
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$ANT_HOME" ] &&
+    ANT_HOME=`cygpath --unix "$ANT_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# set ANT_LIB location
+ANT_LIB="${ANT_HOME}/lib"
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD=`which java 2> /dev/null `
+    if [ -z "$JAVACMD" ] ; then
+        JAVACMD=java
+    fi
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly."
+  echo "  We cannot execute $JAVACMD"
+  exit 1
+fi
+
+# Build local classpath using just the launcher in non-rpm mode or
+# use the Jpackage helper in rpm mode with basic and default jars
+# specified in the ant.conf configuration. Because the launcher is
+# used, libraries linked in ANT_HOME will also be include, but this
+# is discouraged as it is not java-version safe. A user should
+# request optional jars and their dependencies via the OPT_JAR_LIST
+# variable
+if $rpm_mode && [ -f /usr/bin/build-classpath ] ; then
+  LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl xml-commons-apis)"
+  # If the user requested to try to add some other jars to the classpath
+  if [ -n "$OPT_JAR_LIST" ] ; then
+    _OPTCLASSPATH="$(/usr/bin/build-classpath $OPT_JAR_LIST 2> /dev/null)"
+    if [ -n "$_OPTCLASSPATH" ] ; then 
+      LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH"
+    fi
+  fi
+
+  # Explicitly add javac path to classpath, assume JAVA_HOME set
+  # properly in rpm mode
+  if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
+    LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"
+  fi
+  if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
+    LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"
+  fi
+
+  # if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be
+  # user CLASSPATH first and ant-found jars after.
+  # In that case, the user CLASSPATH will override ant-found jars
+  #
+  # if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour
+  # with ant-found jars first and user CLASSPATH after
+  if [ -n "$CLASSPATH" ] ; then
+    # merge local and specified classpath 
+    if [ -z "$LOCALCLASSPATH" ] ; then 
+      LOCALCLASSPATH="$CLASSPATH"
+    elif [ -n "$CLASSPATH_OVERRIDE" ] ; then
+      LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH"
+    else
+      LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH"
+    fi
+
+    # remove class path from launcher -lib option
+    CLASSPATH=""
+  fi
+else
+  # not using rpm_mode; use launcher to determine classpaths
+  if [ -z "$LOCALCLASSPATH" ] ; then
+      LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar
+  else
+      LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
+  fi
+fi
+
+if [ -n "$JAVA_HOME" ] ; then
+  # OSX hack to make Ant work with jikes
+  if $darwin ; then
+    OSXHACK="${JAVA_HOME}/../Classes"
+    if [ -d "${OSXHACK}" ] ; then
+      for i in "${OSXHACK}"/*.jar
+      do
+        JIKESPATH="$JIKESPATH:$i"
+      done
+    fi
+  fi
+fi
+
+# Allow Jikes support (off by default)
+if $usejikes; then
+  ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
+fi
+
+# For Cygwin, switch paths to appropriate format before running java
+if $cygwin; then
+  if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
+    format=mixed
+  else
+    format=windows
+  fi
+  ANT_HOME=`cygpath --$format "$ANT_HOME"`
+  ANT_LIB=`cygpath --$format "$ANT_LIB"`
+  JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
+  LOCALCLASSPATH=`cygpath --path --$format "$LOCALCLASSPATH"`
+  if [ -n "$CLASSPATH" ] ; then
+    CLASSPATH=`cygpath --path --$format "$CLASSPATH"`
+  fi
+  CYGHOME=`cygpath --$format "$HOME"`
+fi
+
+# Show script help if requested
+if $show_help ; then
+  echo $0 '[script options] [options] [target [target2 [target3] ..]]'
+  echo 'Script Options:'
+  echo '  --help, --h            print this message and ant help'
+  echo '  --noconfig             suppress sourcing of /etc/ant.conf,'
+  echo '                         $HOME/.ant/ant.conf, and $HOME/.antrc'
+  echo '                         configuration files'
+  echo '  --usejikes             enable use of jikes by default, unless'
+  echo '                         set explicitly in configuration files'
+  echo '  --execdebug            print ant exec line generated by this'
+  echo '                         launch script'
+  echo '  '
+fi
+# add a second backslash to variables terminated by a backslash under cygwin
+if $cygwin; then
+  case "$ANT_HOME" in
+    *\\ )
+    ANT_HOME="$ANT_HOME\\"
+    ;;
+  esac
+  case "$CYGHOME" in
+    *\\ )
+    CYGHOME="$CYGHOME\\"
+    ;;
+  esac
+  case "$JIKESPATH" in
+    *\\ )
+    JIKESPATH="$JIKESPATH\\"
+    ;;
+  esac
+  case "$LOCALCLASSPATH" in
+    *\\ )
+    LOCALCLASSPATH="$LOCALCLASSPATH\\"
+    ;;
+  esac
+  case "$CLASSPATH" in
+    *\\ )
+    CLASSPATH="$CLASSPATH\\"
+    ;;
+  esac
+fi
+# Execute ant using eval/exec to preserve spaces in paths,
+# java options, and ant args
+ant_sys_opts=
+if [ -n "$CYGHOME" ]; then
+  if [ -n "$JIKESPATH" ]; then
+    ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\""
+  else
+    ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\""
+  fi
+else
+  if [ -n "$JIKESPATH" ]; then
+    ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\""
+  fi
+fi
+ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -lib \"$CLASSPATH\" $ant_exec_args"
+if $ant_exec_debug ; then
+    echo $ant_exec_command
+fi
+eval $ant_exec_command

Added: incubator/lenya/trunk/tools/bin/ant.bat
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/ant.bat	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,106 @@
+@echo off
+
+REM  Copyright 2001,2004 The Apache Software Foundation
+REM
+REM  Licensed under the Apache License, Version 2.0 (the "License");
+REM  you may not use this file except in compliance with the License.
+REM  You may obtain a copy of the License at
+REM
+REM      http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM  Unless required by applicable law or agreed to in writing, software
+REM  distributed under the License is distributed on an "AS IS" BASIS,
+REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM  See the License for the specific language governing permissions and
+REM  limitations under the License.
+
+if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
+
+if "%OS%"=="Windows_NT" @setlocal
+
+rem %~dp0 is expanded pathname of the current script under NT
+set DEFAULT_ANT_HOME=%~dp0..
+
+if "%ANT_HOME%"=="" set ANT_HOME=%DEFAULT_ANT_HOME%
+set DEFAULT_ANT_HOME=
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of arguments (up to the command line limit, anyway).
+set ANT_CMD_LINE_ARGS=%1
+if ""%1""=="""" goto doneStart
+shift
+:setupArgs
+if ""%1""=="""" goto doneStart
+set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
+shift
+goto setupArgs
+rem This label provides a place for the argument list loop to break out
+rem and for NT handling to skip to.
+
+:doneStart
+rem find ANT_HOME if it does not exist due to either an invalid value passed
+rem by the user or the %0 problem on Windows 9x
+if exist "%ANT_HOME%\lib\ant.jar" goto checkJava
+
+rem check for ant in Program Files
+if not exist "%ProgramFiles%\ant" goto checkSystemDrive
+set ANT_HOME=%ProgramFiles%\ant
+goto checkJava
+
+:checkSystemDrive
+rem check for ant in root directory of system drive
+if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
+set ANT_HOME=%SystemDrive%\ant
+goto checkJava
+
+:checkCDrive
+rem check for ant in C:\ant for Win9X users
+if not exist C:\ant\lib\ant.jar goto noAntHome
+set ANT_HOME=C:\ant
+goto checkJava
+
+:noAntHome
+echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
+goto end
+
+:checkJava
+set _JAVACMD=%JAVACMD%
+
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
+goto checkJikes
+
+:noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=java.exe
+
+:checkJikes
+if not "%JIKESPATH%"=="" goto runAntWithJikes
+
+:runAnt
+if not "%CLASSPATH%"=="" goto runAntWithClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
+goto end
+
+:runAntWithClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
+goto end
+
+:runAntWithJikes
+if not "%CLASSPATH%"=="" goto runAntWithJikesAndClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
+goto end
+
+:runAntWithJikesAndClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS%  -lib "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
+goto end
+
+:end
+set _JAVACMD=
+set ANT_CMD_LINE_ARGS=
+
+if "%OS%"=="Windows_NT" @endlocal
+
+:mainEnd
+if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
+

Added: incubator/lenya/trunk/tools/bin/ant.cmd
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/ant.cmd	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,92 @@
+/* 
+    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

Added: incubator/lenya/trunk/tools/bin/antRun
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/antRun	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+#
+#  Copyright  2001-2002,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.
+# 
+#
+
+# Args: DIR command
+cd "$1"
+CMD="$2"
+shift
+shift
+
+exec "$CMD" "$@"

Added: incubator/lenya/trunk/tools/bin/antRun.bat
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/antRun.bat	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,45 @@
+@echo off
+
+REM
+REM Copyright  2001-2002,2004 The Apache Software Foundation
+REM
+REM  Licensed under the Apache License, Version 2.0 (the "License");
+REM  you may not use this file except in compliance with the License.
+REM  You may obtain a copy of the License at
+REM
+REM      http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM  Unless required by applicable law or agreed to in writing, software
+REM  distributed under the License is distributed on an "AS IS" BASIS,
+REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM  See the License for the specific language governing permissions and
+REM  limitations under the License.
+REM
+REM
+
+if "%OS%"=="Windows_NT" @setlocal
+
+if ""%1""=="""" goto runCommand
+
+rem Change drive and directory to %1
+if "%OS%"=="Windows_NT" cd /d ""%1""
+if not "%OS%"=="Windows_NT" cd ""%1""
+shift
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of agruments (up to the command line limit, anyway).
+set ANT_RUN_CMD=%1
+if ""%1""=="""" goto runCommand
+shift
+:loop
+if ""%1""=="""" goto runCommand
+set ANT_RUN_CMD=%ANT_RUN_CMD% %1
+shift
+goto loop
+
+:runCommand
+rem echo %ANT_RUN_CMD%
+%ANT_RUN_CMD%
+
+if "%OS%"=="Windows_NT" @endlocal
+

Added: incubator/lenya/trunk/tools/bin/antRun.pl
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/antRun.pl	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,65 @@
+#!/usr/bin/perl
+#
+# Copyright 2001,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.
+#
+#######################################################################
+#
+# antRun.pl
+#
+# wrapper script for invoking commands on a platform with Perl installed
+# this is akin to antRun.bat, and antRun the SH script 
+#
+# created:         2001-10-18
+# author:          Jeff Tulley jtulley@novell.com 
+#######################################################################
+#be fussy about variables
+use strict;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info (currently unused)
+my $debug=1;
+
+#######################################################################
+# change drive and directory to "%1"
+my $ANT_RUN_CMD = @ARGV[0];
+
+# assign current run command to "%2"
+chdir (@ARGV[0]) || die "Can't cd to $ARGV[0]: $!\n";
+if ($^O eq "NetWare") {
+    # There is a bug in Perl 5 on NetWare, where chdir does not
+    # do anything.  On NetWare, the following path-prefixed form should 
+    # always work. (afaict)
+    $ANT_RUN_CMD .= "/".@ARGV[1];
+}
+else {
+    $ANT_RUN_CMD = @ARGV[1];
+}
+
+# dispose of the first two arguments, leaving only the command's args.
+shift;
+shift;
+
+# run the command
+my $returnValue = system $ANT_RUN_CMD, @ARGV;
+if ($returnValue eq 0) {
+    exit 0;
+}
+else {
+    # only 0 and 1 are widely recognized as exit values
+    # so change the exit value to 1
+    exit 1;
+}

Added: incubator/lenya/trunk/tools/bin/antenv.cmd
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/antenv.cmd	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,99 @@
+/* 
+    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

Added: incubator/lenya/trunk/tools/bin/appendcp.bat
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/appendcp.bat	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,16 @@
+rem  Copyright 1999-2004 The Apache Software Foundation
+rem
+rem  Licensed under the Apache License, Version 2.0 (the "License");
+rem  you may not use this file except in compliance with the License.
+rem  You may obtain a copy of the License at
+rem
+rem      http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem  Unless required by applicable law or agreed to in writing, software
+rem  distributed under the License is distributed on an "AS IS" BASIS,
+rem  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem  See the License for the specific language governing permissions and
+rem  limitations under the License.
+
+set CLASSPATH=%CLASSPATH%;%1
+

Added: incubator/lenya/trunk/tools/bin/complete-ant-cmd.pl
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/complete-ant-cmd.pl	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,113 @@
+#!/usr/bin/perl
+#
+# Copyright 2001,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.
+#
+# A script to allow Bash or Z-Shell to complete an Ant command-line.  
+#
+# To install for Bash 2.0 or better, add the following to ~/.bashrc:
+# 
+#     $ complete -C complete-ant-cmd ant build.sh
+#
+# To install for Z-Shell 2.5 or better, add the following to ~/.zshrc:
+#
+#     function ant_complete () {
+#         local args_line args
+#         read -l args_line
+#         set -A args $args_line
+#         set -A reply $(COMP_LINE=$args_line complete-ant-cmd ${args[1]} $1)
+#     }
+#     compctl -K ant_complete ant build.sh
+#     
+# @author Mike Williams <mi...@cortexebusiness.com.au>
+
+my $cmdLine = $ENV{'COMP_LINE'};
+my $antCmd = $ARGV[0];
+my $word = $ARGV[1];
+
+my @completions;
+if ($word =~ /^-/) {
+    list( restrict( $word, getArguments() ));
+} elsif ($cmdLine =~ /-(f|buildfile)\s+\S*$/) {
+    list( getBuildFiles($word) );
+} else {
+    list( restrict( $word, getTargets() ));
+}
+
+exit(0);
+
+sub list {
+    for (@_) {
+        print "$_\n";
+    }
+}
+
+sub restrict {
+    my ($word, @completions) = @_;
+    grep( /^\Q$word\E/, @completions );
+}
+
+sub getArguments {
+    qw(-buildfile -debug -emacs -f -find -help -listener -logfile 
+       -logger -projecthelp -quiet -verbose -version); 
+}
+
+
+sub getBuildFiles {
+    my ($word) = @_;
+    grep( /\.xml$/, glob( "$word*" ));
+}
+
+sub getTargets {
+
+    # Look for build-file
+    my $buildFile = 'build.xml';
+    if ($cmdLine =~ /-(f|buildfile)\s+(\S+)/) {
+        $buildFile = $2;
+    }
+    return () unless (-f $buildFile);
+
+    # Run "ant -projecthelp" to list targets.  Keep a cache of results in a
+    # cache-file.
+    my $cacheFile = $buildFile;
+    $cacheFile =~ s|(.*/)?(.*)|${1}.ant-targets-${2}|;
+    if ((!-e $cacheFile) || (-M $buildFile) < (-M $cacheFile)) {
+        open( CACHE, '>'.$cacheFile ) || die "can\'t write $cacheFile: $!\n";
+        open( HELP, "$antCmd -projecthelp -f '$buildFile'|" ) || return(); 
+        my %targets;
+        while( <HELP> ) {
+            if (/^\s+(\S+)/) {
+                $targets{$1}++;
+            }
+        }
+        my @targets = sort keys %targets;
+        for (@targets) { print CACHE "$_\n"; }
+        return @targets;
+    }
+    
+    # Read the target-cache
+    open( CACHE, $cacheFile ) || die "can\'t read $cacheFile: $!\n";
+    my @targets;
+    while (<CACHE>) {
+        chop;
+        s/\r$//;  # for Cygwin
+        push( @targets, $_ );
+    }
+    close( CACHE );
+    @targets;
+
+}
+
+
+

Added: incubator/lenya/trunk/tools/bin/create-repository-jars.sh
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/create-repository-jars.sh	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,292 @@
+#!/bin/sh -x
+
+# Copyright 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.
+
+# $Id: create-repository-jars.sh 30946 2004-07-29 20:44:21Z vgritsenko $
+
+# This script will do the following:
+#   - checkout/update a cocoon-2.1 repository
+#   - make a local.build.properties, that excludes all documentation stuff
+#   - build all jars and the war file
+#   - copy all jars and the war to the appropriate locations (repository structure)
+
+# The cvs repository name
+if [ "$REPOSITORY_NAME" = "" ]; then
+  REPOSITORY_NAME=cocoon-2.1
+fi
+
+# What is the default revision/branch/tag to use
+# In case of a HEAD revision a SNAPSHOT version will be created and
+# any old snapshots will be removed to save some space
+if [ "$REVISION" = "" ]; then
+  REVISION="" # it's a HEAD
+fi
+
+# What is the default CVSROOT to be used for checkout
+if [ "$CVSROOT" = "" ]; then
+  CVSROOT=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
+fi
+
+# Where is the local cocoon cvs repository we use to maintain.
+# If this directory doesn't exists it will do a 
+#   'cvs -d $CVSROOT co -Pd $LOCAL_REPOSITORY -r $REVISION $REPOSITORY_NAME'
+#   to create it.
+#   
+# If it exists it will do a 
+#   'cvs upd -dPACr $REVISION'
+#   in there to update to the requested revision (see REVISION below)
+if [ "$LOCAL_REPOSITORY" = "" ]; then
+  LOCAL_REPOSITORY=$HOME/cvs/cocoon-2.1
+fi
+
+# On which host should the artifacts be published
+if [ "$REMOTEHOST" = "" ]; then
+  REMOTEHOST=www.apache.org
+fi
+
+# Where is the path on the remote host the repository is located at
+if [ "$REMOTEPATH" = "" ]; then
+  REMOTEPATH=/www/www.apache.org/dist/java-repository/cocoon
+fi
+
+# Where is the md5sum command to be used
+if [ "$MD5SUM" = "" ]; then
+  MD5SUM=/sbin/md5
+fi
+
+# ------- NO NEED TO CHANGE ANYTHING BELOW HERE ----------
+
+if [ "$JAVA_HOME" = "" ]; then
+  echo "You need to set the JAVA_HOME environment variable to the installed JDK 1.3"
+  exit 1
+fi
+
+$JAVA_HOME/bin/java -version
+
+# parse for options
+NOCVS=0
+NOBUILD=0
+NOCLEAN=0
+NOJARS=0
+NOWAR=0
+BUILD_SRC_DIST=0
+while getopts ":BCdhJkW" option
+do
+  case $option in
+    B) NOBUILD=1;;
+    C) NOCVS=1;;
+    d) BUILD_SRC_DIST=1;;
+    h) echo "Usage: `basename $0` [-B] [-C] [-d] [-J] [-h] [-k] [-W] [RELEASE-TAG]"
+       echo "       -B          don't do a build"
+       echo "       -C          don't do a cvs update"
+       echo "       -d          build a src dist"
+       echo "       -h          this usage note"
+       echo "       -J          don't deploy the jar files"
+       echo "       -k          keep the build tree (don't do a clean-dist)"
+       echo "       -W          don't deploy the war file"
+       echo "       RELEASE-TAG the tag to do a cvs update for"
+       echo "                   if the RELEASE-TAG is HEAD a snapshot version"
+       echo "                   will be produced"
+       exit 0
+       ;;
+    J) NOJARS=1;;
+    k) NOCLEAN=1;;
+    W) NOWAR=1;;
+    *     ) echo "Unimplemented option $option chosen.";;
+  esac
+done
+
+shift $(($OPTIND - 1))
+if [ "$1" != "" -a "$1" != "HEAD" ]; then
+  REVISION=$1
+fi
+
+# check if the local repository exists and do a checkout/update accordingly
+if [ -d "$LOCAL_REPOSITORY" ]; then
+  cd $LOCAL_REPOSITORY
+  if [ $NOCVS = 0 ]; then
+    echo
+    echo "updating the local repository at $LOCAL_REPOSITORY with"
+    if [ "$REVISION" = "" ]; then
+      echo "    cvs up -dPAC"
+      echo
+      cvs up -dPAC
+    else
+      echo "    cvs up -dPACr $REVISION"
+      echo
+      cvs up -dPACr $REVISION
+    fi
+  fi
+else
+  DIRNAME=`dirname $LOCAL_REPOSITORY`
+  BASENAME=`basename $LOCAL_REPOSITORY`
+  if [ ! -d $DIRNAME ]; then
+    mkdir -p $DIRNAME 2>/dev/null >/dev/null
+  fi
+  cd $DIRNAME 
+  echo
+  echo "checking out into the local repository at $LOCAL_REPOSITORY with "
+  if [ "$REVISION" = "" ]; then
+    echo "    cvs -d $CVSROOT co -Pd $LOCAL_REPOSITORY $REPOSITORY_NAME"
+    echo
+    cvs -d $CVSROOT co -Pd $BASENAME $REPOSITORY_NAME
+  else
+    echo "    cvs -d $CVSROOT co -Pd $LOCAL_REPOSITORY -r $REVISION $REPOSITORY_NAME"
+    echo
+    cvs -d $CVSROOT co -Pd $BASENAME -r $REVISION $REPOSITORY_NAME
+  fi
+  cd $LOCAL_REPOSITORY
+fi
+
+# cleanup the repository, prepare and do a build if not suppressed by command line option
+RC=0 # set in advace in case we don't do a build
+if [ $NOBUILD = 0 ]; then
+  # build the local.blocks.properties file
+  echo
+  echo "generating local.blocks.properties file"
+  echo
+  cat blocks.properties \
+    >local.blocks.properties
+
+  # build the local.build.properties file
+  echo
+  echo "generating local.build.properties file"
+  echo
+  cat build.properties \
+    | sed 's/#exclude.webapp.documentation/exclude.webapp.documentation/' \
+    | sed 's/#exclude.webapp.javadocs/exclude.webapp.javadocs/' \
+    | sed 's/#exclude.webapp.samples/exclude.webapp.samples/' \
+    | sed 's/#exclude.documentation/exclude.documentation/' \
+    | sed 's/#exclude.javadocs/exclude.javadocs/' \
+    | sed 's/#exclude.validate.xdocs/exclude.validate.xdocs/' \
+    | sed 's/#config.allow-reloads/config.allow-reloads/' \
+    | sed 's/#config.enable-uploads/config.enable-uploads/' >local.build.properties
+
+  # build everything
+  echo
+  if [ $NOCLEAN = 0 ]; then
+    echo "clean the local repository, build the webapp, and the war files"
+    CLEAN=clean-dist
+  else
+    echo "build the webapp, and the war files"
+    CLEAN=""
+  fi
+  echo
+  ./build.sh $CLEAN webapp war | tee $LOCAL_REPOSITORY/build.log
+  # The build script dosn't report on failures so we have to do that by hand
+  tail -10 $LOCAL_REPOSITORY/build.log|grep "BUILD SUCCESSFUL"
+  if [ $? = 0 ]; then
+    RC=0
+  else
+    RC=1
+  fi
+fi
+
+if [ $RC -ne 0 ]; then
+  echo "The build has failed"
+  exit $RC
+fi
+
+# copy all the jars produced over to the remote repository space
+VERSION=`ls build | grep cocoon | sed s/cocoon-//`
+if [ "$REVISION" = "" ]; then 
+  TVERSION=`date "+%Y%m%d.%H%M%S"` 
+else
+  TVERSION=$VERSION
+fi
+
+if [ $NOJARS = 0 ]; then
+  # create the target directory if they do not exists and make them group writable
+  ssh $REMOTEHOST "mkdir -p $REMOTEPATH/jars 2>/dev/null >/dev/null; \
+                 chmod -R g+w $REMOTEPATHi/jars"
+  JARS=`find build/cocoon-$VERSION -name "*.jar"`
+  for i in $JARS; do
+    FILE=`echo $i | sed 's/.*[/]//' | sed s/[.]jar//`
+    isBlock=`echo $FILE|grep block`
+    if [ ! -z "$isBlock" ]; then
+      BLOCKPART="-`echo $FILE | sed 's/-block//'`"
+    else
+      BLOCKPART=`echo $FILE | sed 's/cocoon//'`
+    fi
+    if [ "$REVISION" = "" ]; then
+      # remove all snapshots in the remote repository
+      SNAPSHOT=`ssh $REMOTEHOST "ls $REMOTEPATH/jars/cocoon$BLOCKPART-????????.??????.jar 2>/dev/null"` 
+    fi
+    scp $i $REMOTEHOST:$REMOTEPATH/jars/cocoon$BLOCKPART-$TVERSION.jar
+    if [ "$REVISION" = "" ]; then
+      if [ ! -z "$SNAPSHOT" ]; then
+        RM="rm $SNAPSHOT;"
+      else
+        RM=""
+      fi
+      CMD="$RM \
+           cd $REMOTEPATH/jars; \
+           ln -fs cocoon$BLOCKPART-$TVERSION.jar cocoon$BLOCKPART-SNAPSHOT.jar; \
+           echo $TVERSION >cocoon$BLOCKPART-snapshot.version;"
+    else
+      CMD=""
+    fi
+    ssh $REMOTEHOST "$CMD \
+                     $MD5SUM <$REMOTEPATH/jars/cocoon$BLOCKPART-$TVERSION.jar | \
+                       sed 's/ .*$//' >$REMOTEPATH/jars/cocoon$BLOCKPART-$TVERSION.jar.md5; \
+                     chmod g+w $REMOTEPATH/jars/cocoon$BLOCKPART-$TVERSION.*"
+  done
+fi
+
+# copy the war file to the web space
+if [ "$NOWAR" = "0" ]; then
+  # create the target directory if they do not exists and make them group writable
+  ssh $REMOTEHOST "mkdir -p $REMOTEPATH/wars 2>/dev/null >/dev/null; \
+                   chmod -R g+w $REMOTEPATH/wars"
+  WAR=build/cocoon-$VERSION/cocoon.war
+  if [ "$REVISION" = "" ]; then
+    SNAPSHOT=`ssh $REMOTEHOST "ls $REMOTEPATH/wars/cocoon-war-????????.??????.war 2>/dev/null"` 
+  fi
+  scp $WAR $REMOTEHOST:$REMOTEPATH/wars/cocoon-war-$TVERSION.war
+  if [ "$REVISION" = "" ]; then
+    if [ ! -z "$SNAPSHOT" ]; then
+      RM="rm $SNAPSHOT;"
+    else
+      RM=""
+    fi
+    CMD="$RM \
+         cd $REMOTEPATH/wars; \
+         ln -fs cocoon-war-$TVERSION.war cocoon-war-SNAPSHOT.war; \
+         echo $TVERSION >cocoon-war-snapshot.version;"
+  else
+    CMD=""
+  fi
+  ssh $REMOTEHOST "$CMD \
+                   $MD5SUM <$REMOTEPATH/wars/cocoon-war-$TVERSION.war | \
+                     sed 's/ .*$//' >$REMOTEPATH/jars/cocoon-war-$TVERSION.jar.md5; \
+                   chmod g+w $REMOTEPATH/jars/cocoon-war-$TVERSION.*"
+fi
+
+# create a distribution
+if [ "$BUILD_SRC_DIST" = "1" ]; then
+  # create the target directory if they do not exists and make them group writable
+  ssh $REMOTEHOST "mkdir -p $REMOTEPATH/distributions 2>/dev/null >/dev/null; \
+                   chmod -R g+w $REMOTEPATH/distributions"
+  ./build.sh clean-dist
+  cd ..
+  if [ "$REVISION" = "" ]; then
+    TVERSION=SNAPSHOT
+  fi
+  ln -sf $REPOSITORY_NAME cocoon-src-$TVERSION
+  zip -r cocoon-src-$TVERSION.zip cocoon-src-$TVERSION
+  rm cocoon-src-$TVERSION
+  scp cocoon-src-$TVERSION.zip $REMOTEHOST:$REMOTEPATH/distributions/cocoon-src-$TVERSION.zip
+  rm cocoon-src-$TVERSION.zip
+fi

Added: incubator/lenya/trunk/tools/bin/envset.cmd
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/envset.cmd	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,130 @@
+/*
+
+    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

Added: incubator/lenya/trunk/tools/bin/lcp.bat
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/lcp.bat	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,30 @@
+REM
+REM Copyright  2001-2004 The Apache Software Foundation
+REM
+REM  Licensed under the Apache License, Version 2.0 (the "License");
+REM  you may not use this file except in compliance with the License.
+REM  You may obtain a copy of the License at
+REM
+REM      http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM  Unless required by applicable law or agreed to in writing, software
+REM  distributed under the License is distributed on an "AS IS" BASIS,
+REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM  See the License for the specific language governing permissions and
+REM  limitations under the License.
+REM
+REM
+
+set _CLASSPATHCOMPONENT=%1
+if ""%1""=="""" goto gotAllArgs
+shift
+
+:argCheck
+if ""%1""=="""" goto gotAllArgs
+set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
+shift
+goto argCheck
+
+:gotAllArgs
+set LOCALCLASSPATH=%_CLASSPATHCOMPONENT%;%LOCALCLASSPATH%
+

Added: incubator/lenya/trunk/tools/bin/runant.pl
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/runant.pl	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,152 @@
+#!/usr/bin/perl
+#
+# Copyright 2000-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.
+#
+#######################################################################
+#
+# runant.pl
+#
+# wrapper script for invoking ant in a platform with Perl installed
+# this may include cgi-bin invocation, which is considered somewhat daft.
+# (slo: that should be a separate file which can be derived from this
+# and returns the XML formatted output)
+#
+# the code is not totally portable due to classpath and directory splitting
+# issues. oops. (NB, use File::Spec::Functions  will help and the code is
+# structured for the catfile() call, but because of perl version funnies
+# the code is not included. 
+#
+# created:         2000-8-24
+# author:          Steve Loughran steve_l@sourceforge.net
+#######################################################################
+#
+# Assumptions:
+#
+# - the "java" executable/script is on the command path
+# - ANT_HOME has been set
+# - target platform uses ":" as classpath separator or perl indicates it is dos/win32
+# - target platform uses "/" as directory separator.
+
+#be fussy about variables
+use strict;
+
+#platform specifics (disabled)
+#use File::Spec::Functions;
+
+#turn warnings on during dev; generates a few spurious uninitialised var access warnings
+#use warnings;
+
+#and set $debug to 1 to turn on trace info
+my $debug=1;
+
+#######################################################################
+#
+# check to make sure environment is setup
+#
+
+my $HOME = $ENV{ANT_HOME};
+if ($HOME eq "")
+        {
+    die "\n\nANT_HOME *MUST* be set!\n\n";
+        }
+
+my $JAVACMD = $ENV{JAVACMD};
+$JAVACMD = "java" if $JAVACMD eq "";
+
+my $onnetware = 0;
+if ($^O eq "NetWare")
+{
+  $onnetware = 1;
+}
+
+my $oncygwin = ($^O eq "cygwin");
+
+#ISSUE: what java wants to split up classpath varies from platform to platform 
+#and perl is not too hot at hinting which box it is on.
+#here I assume ":" 'cept on win32, dos, and netware. Add extra tests here as needed.
+my $s=":";
+if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin") ||
+   ($onnetware == 1))
+        {
+        $s=";";
+        }
+
+#build up standard classpath
+my $localpath = "$HOME/lib/ant-launcher.jar";
+#set JVM options and Ant arguments, if any
+my @ANT_OPTS=split(" ", $ENV{ANT_OPTS});
+my @ANT_ARGS=split(" ", $ENV{ANT_ARGS});
+
+#jikes
+if($ENV{JIKESPATH} ne "")
+        {
+        push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
+        }
+
+#construct arguments to java
+my @ARGS;
+push @ARGS, @ANT_OPTS;
+
+my $CYGHOME = "";
+
+my $classpath=$ENV{CLASSPATH};
+if ($oncygwin == 1) {
+  $localpath = `cygpath --path --windows $localpath`;
+  chomp ($localpath);
+  if (! $classpath eq "")
+  {
+    $classpath = `cygpath --path --windows "$classpath"`;
+    chomp ($classpath);
+  }
+  $HOME = `cygpath --path --windows $HOME`;
+  chomp ($HOME);
+  $CYGHOME = `cygpath --path --windows $ENV{HOME}`;
+  chomp ($CYGHOME);
+}
+push @ARGS, "-classpath", "$localpath";
+push @ARGS, "-Dant.home=$HOME";
+if ( ! $CYGHOME eq "" )
+{
+  push @ARGS, "-Dcygwin.user.home=\"$CYGHOME\""
+}
+push @ARGS, "org.apache.tools.ant.launch.Launcher", @ANT_ARGS;
+push @ARGS, @ARGV;
+if (! $classpath eq "")
+{
+  if ($onnetware == 1)
+  {
+    # make classpath literally $CLASSPATH
+    # this is to avoid pushing us over the 512 character limit
+    # even skip the ; - that is already in $localpath
+    push @ARGS, "-lib", "\$CLASSPATH";
+  }
+  else
+  {
+    push @ARGS, "-lib", "$classpath";
+  }
+}
+print "\n $JAVACMD @ARGS\n\n" if ($debug);
+
+my $returnValue = system $JAVACMD, @ARGS;
+if ($returnValue eq 0)
+        {
+        exit 0;
+        }
+else
+        {
+        # only 0 and 1 are widely recognized as exit values
+        # so change the exit value to 1
+        exit 1;
+        }

Added: incubator/lenya/trunk/tools/bin/runant.py
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/runant.py	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,100 @@
+#!/usr/bin/python
+# Copyright 2001,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.
+#
+
+"""
+
+ runant.py
+
+    This script is a translation of the runant.pl written by Steve Loughran.
+    It runs ant with/out arguments, it should be quite portable (thanks to
+    the python os library)
+    This script has been tested with Python2.0/Win2K
+
+ created:         2001-04-11
+ author:          Pierre Dittgen pierre.dittgen@criltelecom.com
+
+ Assumptions:
+
+ - the "java" executable/script is on the command path
+"""
+import os, os.path, string, sys
+
+# Change it to 1 to get extra debug information
+debug = 0
+
+#######################################################################
+
+# If ANT_HOME is not set default to script's parent directory
+if os.environ.has_key('ANT_HOME'):
+    ANT_HOME = os.environ['ANT_HOME']
+else:
+    ANT_HOME = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
+
+# set ANT_LIB location
+ANT_LIB = os.path.join(ANT_HOME, 'lib')
+
+# set JAVACMD (check variables JAVACMD and JAVA_HOME)
+JAVACMD = None
+if not os.environ.has_key('JAVACMD'):
+    if os.environ.has_key('JAVA_HOME'):
+        if not os.path.exists(os.environ['JAVA_HOME']):
+            print "Warning: JAVA_HOME is not defined correctly."
+        else:
+            JAVACMD = os.path.join(os.environ['JAVA_HOME'], 'bin', 'java')
+    else:
+        print "Warning: JAVA_HOME not set."
+else:
+    JAVACMD = os.environ['JAVACMD']
+if not JAVACMD:
+    JAVACMD = 'java'
+
+launcher_jar = os.path.join(ANT_LIB, 'ant-launcher.jar')
+if not os.path.exists(launcher_jar):
+    print 'Unable to locate ant-launcher.jar. Expected to find it in %s' % \
+        ANT_LIB
+
+# Build up standard classpath (LOCALCLASSPATH)
+LOCALCLASSPATH = launcher_jar
+if os.environ.has_key('LOCALCLASSPATH'):
+    LOCALCLASSPATH += os.pathsep + os.environ['LOCALCLASSPATH']
+
+ANT_OPTS = ""
+if os.environ.has_key('ANT_OPTS'):
+    ANT_OPTS = os.environ['ANT_OPTS']
+
+OPTS = ""
+if os.environ.has_key('JIKESPATH'):
+    OPTS = '-Djikes.class.path=\"%s\"' % os.environ['JIKESPATH']
+
+ANT_ARGS = ""
+if os.environ.has_key('ANT_ARGS'):
+    ANT_ARGS = os.environ['ANT_ARGS']
+
+CLASSPATH = ""
+if os.environ.has_key('CLASSPATH'):
+    CLASSPATH = os.environ['CLASSPATH']
+
+# Builds the commandline
+cmdline = ('%s %s -classpath %s -Dant.home=%s %s ' + \
+    'org.apache.tools.ant.launch.Launcher %s -lib %s %s') \
+     % (JAVACMD, ANT_OPTS, LOCALCLASSPATH, ANT_HOME, OPTS, ANT_ARGS, \
+        CLASSPATH, string.join(sys.argv[1:], ' '))
+
+if debug:
+    print '\n%s\n\n' % (cmdline)
+
+# Run the biniou!
+os.system(cmdline)

Added: incubator/lenya/trunk/tools/bin/runrc.cmd
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/tools/bin/runrc.cmd	Sun Oct 24 09:42:21 2004
@@ -0,0 +1,59 @@
+/* 
+    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

Added: incubator/lenya/trunk/tools/lib/ant-contrib-0.6.jar
==============================================================================
Binary file. No diff available.

Added: incubator/lenya/trunk/tools/lib/ant-junit.jar
==============================================================================
Binary file. No diff available.

Added: incubator/lenya/trunk/tools/lib/ant-launcher.jar
==============================================================================
Binary file. No diff available.

Added: incubator/lenya/trunk/tools/lib/ant-trax.jar
==============================================================================
Binary file. No diff available.

Added: incubator/lenya/trunk/tools/lib/ant.jar
==============================================================================
Binary file. No diff available.

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org