From d37eeb035adafa5fdaf518fc54115568d91fb41b Mon Sep 17 00:00:00 2001 From: mjohnson Date: Sun, 3 Mar 2002 22:25:28 +0000 Subject: [PATCH] more stuff from Ken's build patch git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352143 13f79535-47bb-0310-9956-ffa450edef68 --- project-info.xml | 46 ++ src/contrib/targets/contrib.xtarget | 30 + src/contrib/targets/poibrowser.xml | 26 + src/scratchpad/targets/scratchpad.xtarget | 30 + src/targets/interactive.xtarget | 32 + src/targets/project.xtarget | 9 + src/targets/try.xml | 15 + tools/ant/bin/ant | 107 +++ tools/ant/bin/ant.bat | 97 +++ tools/ant/bin/antRun | 9 + tools/ant/bin/antRun.bat | 20 + tools/ant/bin/fix-packages.py | 216 ++++++ tools/ant/bin/lcp.bat | 2 + tools/ant/bin/runant.pl | 131 ++++ tools/centipede/lib/VERSIONS | 3 + .../src/java/ClassAvailableTask.java | 159 ++++ .../src/java/IZPressHtmlCompressTask.java | 179 +++++ tools/centipede/src/java/JTidyTask.java | 279 +++++++ tools/centipede/src/java/UserInputTask.java | 91 +++ tools/centipede/src/java/XmlPropertyTask.java | 226 ++++++ .../src/resources/Release-Checklist.txt | 18 + .../stylesheets/announcement2readme.xsl | 89 +++ .../stylesheets/announcement2txt.xsl | 174 +++++ .../stylesheets/bugzilla2patchqueue.xsl | 36 + .../src/resources/stylesheets/changelog.xsl | 95 +++ .../stylesheets/patchqueue2text4dev.xsl | 70 ++ .../stylesheets/patchqueue2xdocs.xsl | 109 +++ tools/centipede/targets/compile.xtarget | 130 ++++ tools/centipede/targets/dev.xtarget | 224 ++++++ tools/centipede/targets/docs.xtarget | 183 +++++ tools/centipede/targets/init.xtarget | 144 ++++ tools/centipede/targets/preinit.xtarget | 63 ++ tools/centipede/targets/robot.xtarget | 75 ++ tools/centipede/targets/test.xtarget | 40 + tools/centipede/targets/util.xtarget | 22 + tools/cocoon/conf/cocoon.xconf | 718 ++++++++++++++++++ 36 files changed, 3897 insertions(+) create mode 100644 project-info.xml create mode 100644 src/contrib/targets/contrib.xtarget create mode 100644 src/contrib/targets/poibrowser.xml create mode 100644 src/scratchpad/targets/scratchpad.xtarget create mode 100644 src/targets/interactive.xtarget create mode 100644 src/targets/project.xtarget create mode 100644 src/targets/try.xml create mode 100755 tools/ant/bin/ant create mode 100644 tools/ant/bin/ant.bat create mode 100755 tools/ant/bin/antRun create mode 100644 tools/ant/bin/antRun.bat create mode 100644 tools/ant/bin/fix-packages.py create mode 100644 tools/ant/bin/lcp.bat create mode 100644 tools/ant/bin/runant.pl create mode 100644 tools/centipede/lib/VERSIONS create mode 100644 tools/centipede/src/java/ClassAvailableTask.java create mode 100644 tools/centipede/src/java/IZPressHtmlCompressTask.java create mode 100644 tools/centipede/src/java/JTidyTask.java create mode 100644 tools/centipede/src/java/UserInputTask.java create mode 100644 tools/centipede/src/java/XmlPropertyTask.java create mode 100644 tools/centipede/src/resources/Release-Checklist.txt create mode 100644 tools/centipede/src/resources/stylesheets/announcement2readme.xsl create mode 100644 tools/centipede/src/resources/stylesheets/announcement2txt.xsl create mode 100644 tools/centipede/src/resources/stylesheets/bugzilla2patchqueue.xsl create mode 100644 tools/centipede/src/resources/stylesheets/changelog.xsl create mode 100644 tools/centipede/src/resources/stylesheets/patchqueue2text4dev.xsl create mode 100644 tools/centipede/src/resources/stylesheets/patchqueue2xdocs.xsl create mode 100644 tools/centipede/targets/compile.xtarget create mode 100644 tools/centipede/targets/dev.xtarget create mode 100644 tools/centipede/targets/docs.xtarget create mode 100644 tools/centipede/targets/init.xtarget create mode 100644 tools/centipede/targets/preinit.xtarget create mode 100644 tools/centipede/targets/robot.xtarget create mode 100644 tools/centipede/targets/test.xtarget create mode 100644 tools/centipede/targets/util.xtarget create mode 100644 tools/cocoon/conf/cocoon.xconf diff --git a/project-info.xml b/project-info.xml new file mode 100644 index 000000000..5adedfc49 --- /dev/null +++ b/project-info.xml @@ -0,0 +1,46 @@ + + + + + + The POI project consists of APIs for manipulating various file formats based upon Microsoft's OLE 2 Compound Document format using pure Java. + + A common misconception is that POI writes Excel files. POI is the name of the project. POI contains several components, one of which, HSSF, writes Excel files. The following are components of the entire POI project.POIFS is the oldest and most stable part of the project. It is our port of the OLE 2 Compound Document Format to pure Java. It supports both read and write functionality. All of our components ultimately rely on it by definition. HSSF is our port of the Microsoft Excel 97(-2002) file format (BIFF8) to pure Java. It supports read and write capability. HDF is our port of the Microsoft Word 97 file format to pure Java. It supports read and write capability. This component is in the early stages of design. Jump in! + + The home page for the POI project can be found on the web site (http://jakarta.apache.org/poi/). There you also find information on how to download the latest release as well as all the other information you might need regarding this project. + + The for installing it you need a Java 1.2 or later compatible virtual machine for your operating system. + + The documentation available as of the date of this release is included in the "docs/" directory. The documentation sources are in the "src/documentation" directory. Look for the most updated documentation on the web site. + + For legal and licensing issues, please read the LICENSE.* files in the /legal directory. + + + + + + + + + + + + + + + + + + + + This product includes software developed by the Krysalis Project (http://www.krysalis.org/). + + + diff --git a/src/contrib/targets/contrib.xtarget b/src/contrib/targets/contrib.xtarget new file mode 100644 index 000000000..e17bcf962 --- /dev/null +++ b/src/contrib/targets/contrib.xtarget @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Please select a target + + + + + diff --git a/src/contrib/targets/poibrowser.xml b/src/contrib/targets/poibrowser.xml new file mode 100644 index 000000000..7d9c313ff --- /dev/null +++ b/src/contrib/targets/poibrowser.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + Please select a file to view + + + + + + + + + + + + + + diff --git a/src/scratchpad/targets/scratchpad.xtarget b/src/scratchpad/targets/scratchpad.xtarget new file mode 100644 index 000000000..5624e339a --- /dev/null +++ b/src/scratchpad/targets/scratchpad.xtarget @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Please select a target + + + + diff --git a/src/targets/interactive.xtarget b/src/targets/interactive.xtarget new file mode 100644 index 000000000..3d17e2635 --- /dev/null +++ b/src/targets/interactive.xtarget @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Please select a target + + + + diff --git a/src/targets/project.xtarget b/src/targets/project.xtarget new file mode 100644 index 000000000..bae5fa9ec --- /dev/null +++ b/src/targets/project.xtarget @@ -0,0 +1,9 @@ + + + + + diff --git a/src/targets/try.xml b/src/targets/try.xml new file mode 100644 index 000000000..695b2253c --- /dev/null +++ b/src/targets/try.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/tools/ant/bin/ant b/tools/ant/bin/ant new file mode 100755 index 000000000..4555bf708 --- /dev/null +++ b/tools/ant/bin/ant @@ -0,0 +1,107 @@ +#! /bin/sh + +if [ -f "$HOME/.antrc" ] ; then + . $HOME/.antrc +fi + +# Cygwin support. $cygwin _must_ be set to either true or false. +case "`uname`" in + CYGWIN*) cygwin=true ;; + *) cygwin=false ;; +esac + +# 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"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +if [ "$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` + + 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"`/.. + +fi + +if [ "$JAVA_HOME" != "" ] ; then + if [ "$JAVACMD" = "" ] ; then + JAVACMD=$JAVA_HOME/bin/java + fi +else + if [ "$JAVACMD" = "" ] ; then + JAVACMD=java + fi +fi + +# add in the dependency .jar files +DIRLIBS=${ANT_HOME}/lib/*.jar +for i in ${DIRLIBS} +do + # if the directory is empty, then it will return the input string + # this is stupid, so case for it + if [ "$i" != "${DIRLIBS}" ] ; then + LOCALCLASSPATH=$LOCALCLASSPATH:"$i" + fi +done + +if [ "$CLASSPATH" != "" ] ; then + LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH +fi + +if [ "$JAVA_HOME" != "" ] ; then + if test -f $JAVA_HOME/lib/tools.jar ; then + LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar + fi + + if test -f $JAVA_HOME/lib/classes.zip ; then + LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip + fi +else + echo "Warning: JAVA_HOME environment variable is not set." + echo " If build fails because sun.* classes could not be found" + echo " you will need to set the JAVA_HOME environment variable" + echo " to the installation directory of java." +fi + +# supply JIKESPATH to Ant as jikes.class.path +if [ "$JIKESPATH" != "" ] ; then + if [ "$ANT_OPTS" != "" ] ; then + ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH" + else + ANT_OPTS=-Djikes.class.path=$JIKESPATH + fi +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + ANT_HOME=`cygpath --path --windows "$ANT_HOME"` + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` +fi + +$JAVACMD -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main "$@" diff --git a/tools/ant/bin/ant.bat b/tools/ant/bin/ant.bat new file mode 100644 index 000000000..e8f8fd1e8 --- /dev/null +++ b/tools/ant/bin/ant.bat @@ -0,0 +1,97 @@ +@echo off + +if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat" + +if not "%OS%"=="Windows_NT" goto win9xStart +:winNTStart +@setlocal + +rem %~dp0 is name of current script under NT +set DEFAULT_ANT_HOME=%~dp0 + +rem : operator works similar to make : operator +set DEFAULT_ANT_HOME=%DEFAULT_ANT_HOME:\bin\=% + +if %ANT_HOME%a==a set ANT_HOME=%DEFAULT_ANT_HOME% +set DEFAULT_ANT_HOME= + +rem On NT/2K grab all arguments at once +set ANT_CMD_LINE_ARGS=%* +goto doneStart + +:win9xStart +rem Slurp the command line arguments. This loop allows for an unlimited number of +rem agruments (up to the command line limit, anyway). + +set ANT_CMD_LINE_ARGS= + +:setupArgs +if %1a==a goto doneStart +set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1 +shift +goto setupArgs + +:doneStart +rem This label provides a place for the argument list loop to break out +rem and for NT handling to skip to. + +rem find ANT_HOME +if not "%ANT_HOME%"=="" goto checkJava + +rem check for ant in Program Files on system drive +if not exist "%SystemDrive%\Program Files\ant" goto checkSystemDrive +set ANT_HOME=%SystemDrive%\Program Files\ant +goto checkJava + +:checkSystemDrive +rem check for ant in root directory of system drive +if not exist "%SystemDrive%\ant" goto noAntHome +set ANT_HOME=%SystemDrive%\ant +goto checkJava + +:noAntHome +echo ANT_HOME is not set and ant could not be located. Please set ANT_HOME. +goto end + +:checkJava +set _JAVACMD=%JAVACMD% +set LOCALCLASSPATH="%CLASSPATH%" +for %%i in ("%ANT_HOME%\lib\*.jar") do call "%ANT_HOME%\bin\lcp.bat" "%%i" + +if "%JAVA_HOME%" == "" goto noJavaHome +if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java +if exist "%JAVA_HOME%\lib\tools.jar" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\tools.jar" +if exist "%JAVA_HOME%\lib\classes.zip" call "%ANT_HOME%\bin\lcp.bat" "%JAVA_HOME%\lib\classes.zip" +goto checkJikes + +:noJavaHome +if "%_JAVACMD%" == "" set _JAVACMD=java +echo. +echo Warning: JAVA_HOME environment variable is not set. +echo If build fails because sun.* classes could not be found +echo you will need to set the JAVA_HOME environment variable +echo to the installation directory of java. +echo. + +:checkJikes +if not "%JIKESPATH%" == "" goto runAntWithJikes + +:runAnt +%_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% +goto end + +:runAntWithJikes +%_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" -Djikes.class.path=%JIKESPATH% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% + +:end +set LOCALCLASSPATH= +set _JAVACMD= +set ANT_CMD_LINE_ARGS= + +if not "%OS%"=="Windows_NT" goto mainEnd +:winNTend +@endlocal + +:mainEnd +if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat" + diff --git a/tools/ant/bin/antRun b/tools/ant/bin/antRun new file mode 100755 index 000000000..f0a18f165 --- /dev/null +++ b/tools/ant/bin/antRun @@ -0,0 +1,9 @@ +#! /bin/sh + +# Args: DIR command +cd "$1" +CMD="$2" +shift +shift + +exec $CMD "$@" diff --git a/tools/ant/bin/antRun.bat b/tools/ant/bin/antRun.bat new file mode 100644 index 000000000..a5484d692 --- /dev/null +++ b/tools/ant/bin/antRun.bat @@ -0,0 +1,20 @@ +@echo off + +# Change drive and directory to %1 (Win9X only for NT/2K use "cd /d") +cd %1 +%1\ +set ANT_RUN_CMD=%2 +shift +shift + +set PARAMS= +:loop +if ""%1 == "" goto runCommand +set PARAMS=%PARAMS% %1 +shift +goto loop + +:runCommand +rem echo %ANT_RUN_CMD% %PARAMS% +%ANT_RUN_CMD% %PARAMS% + diff --git a/tools/ant/bin/fix-packages.py b/tools/ant/bin/fix-packages.py new file mode 100644 index 000000000..5858c77a7 --- /dev/null +++ b/tools/ant/bin/fix-packages.py @@ -0,0 +1,216 @@ +#! /usr/bin/env python +# +# Mass string translation for java/xml files (change Wanted re for other files) +# +# Author: Peter Donald +# +# Adapted from fixid.py in python distribution under Tools +# + +import sys +import re +import string +import os +from stat import * +import getopt + +err = sys.stderr.write +dbg = err +out = sys.stdout.write + +def usage(): + progname = sys.argv[0] + err('Usage: ' + progname + ' [-s file] ... file-or-directory ...\n') + err('\n') + err('-s substfile : add a file of substitutions\n') + err('\n') + err('Each non-empty non-comment line in a substitution file must\n') + err('contain exactly two words separated by a | character.\n') + +def main(): + try: + opts, args = getopt.getopt(sys.argv[1:], 'crs:') + except getopt.error, msg: + err('Options error: ' + str(msg) + '\n') + usage() + sys.exit(2) + bad = 0 + if not args: # No arguments + usage() + sys.exit(2) + for opt, arg in opts: + if opt == '-s': + addsubst(arg) + initre() + for arg in args: + if os.path.isdir(arg): + if recursedown(arg): bad = 1 + elif os.path.islink(arg): + err(arg + ': will not process symbolic links\n') + bad = 1 + else: + if fix(arg): bad = 1 + sys.exit(bad) + +# Change this regular expression to select a different set of files +Wanted = '^[a-zA-Z0-9_\-]+\.(java|xml|xinfo)$' +def wanted(name): + return None <> re.match(Wanted, name) + +def recursedown(dirname): + dbg('recursedown(' + `dirname` + ')\n') + bad = 0 + try: + names = os.listdir(dirname) + except os.error, msg: + err(dirname + ': cannot list directory: ' + str(msg) + '\n') + return 1 + names.sort() + subdirs = [] + for name in names: + if name in (os.curdir, os.pardir): continue + fullname = os.path.join(dirname, name) + if os.path.islink(fullname): pass + elif os.path.isdir(fullname): + subdirs.append(fullname) + elif wanted(name): + if fix(fullname): bad = 1 + for fullname in subdirs: + if recursedown(fullname): bad = 1 + return bad + +def fix(filename): + dbg('fix(' + `filename` + ')\n') + + # File replacement mode + try: + f = open(filename, 'r') + except IOError, msg: + err(filename + ': cannot open: ' + str(msg) + '\n') + return 1 + + head, tail = os.path.split(filename) + tempname = os.path.join(head, '@' + tail) + + # If we find a match, we rewind the file and start over but + # now copy everything to a temp file. + lineno = 0 + g = None + while 1: + line = f.readline() + if not line: break + lineno = lineno + 1 + newline = fixline(line) + if newline != line: + if g is None: + try: + g = open(tempname, 'w') + except IOError, msg: + f.close() + err(tempname+': cannot create: '+ + str(msg)+'\n') + return 1 + f.seek(0) + lineno = 0 + out(filename + ':\n') + continue # restart from the beginning + out(`lineno` + '\n') + out('< ' + line) + out('> ' + newline) + if g is not None: + g.write(newline) + + # End of file + f.close() + if not g: return 0 # No changes + + # Finishing touch -- move files + + # First copy the file's mode to the temp file + try: + statbuf = os.stat(filename) + os.chmod(tempname, statbuf[ST_MODE] & 07777) + except os.error, msg: + err(tempname + ': warning: chmod failed (' + str(msg) + ')\n') + + # Then make a backup of the original file as filename~ + try: + os.rename(filename, filename + '~') + except os.error, msg: + err(filename + ': warning: backup failed (' + str(msg) + ')\n') + + # Now move the temp file to the original file + try: + os.rename(tempname, filename) + except os.error, msg: + err(filename + ': rename failed (' + str(msg) + ')\n') + return 1 + + # Return succes + return 0 + +def initre(): + global SearcherExpr + + keys = Dict.keys() + keyCount = len(keys) + i = 0 + reStr = "" + while i < len(keys): + if i != 0: reStr = reStr + '|' + reStr = reStr + keys[i] + i = i + 1 + SearcherExpr = re.compile( reStr ) + +def fixline(line): + global Program +## print '-->', `line` + i = 0 + + while i < len(line): + match = SearcherExpr.search(line, i) + if match == None: break + found = match.group(0) + i = match.start() + n = len(found) + if Dict.has_key(found): + subst = Dict[found] + + line = line[:i] + subst + line[i+n:] + n = len(subst) + i = i + n + return line + +Dict = {} +NotInComment = {} + +def addsubst(substfile): + try: + fp = open(substfile, 'r') + except IOError, msg: + err(substfile + ': cannot read substfile: ' + str(msg) + '\n') + sys.exit(1) + lineno = 0 + + while 1: + line = fp.readline() + if not line: break + lineno = lineno + 1 + try: + i = string.index(line, '#') + except string.index_error: + i = -1 # Happens to delete trailing \n + words = string.split(line[:i],'|') + if not words: continue + if len(words) <> 2: + err(substfile + ':' + `lineno` + ': warning: bad line: ' + line) + continue + [key, value] = words + +## print 'Will replace ', key, ' with ', value + + Dict[key] = value + + fp.close() + +main() diff --git a/tools/ant/bin/lcp.bat b/tools/ant/bin/lcp.bat new file mode 100644 index 000000000..8d6b8515a --- /dev/null +++ b/tools/ant/bin/lcp.bat @@ -0,0 +1,2 @@ +set LOCALCLASSPATH=%1;%LOCALCLASSPATH% + diff --git a/tools/ant/bin/runant.pl b/tools/ant/bin/runant.pl new file mode 100644 index 000000000..a2cc523e7 --- /dev/null +++ b/tools/ant/bin/runant.pl @@ -0,0 +1,131 @@ +#!/usr/bin/perl +####################################################################### +# +# 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 +# last modified: 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=0; + +####################################################################### +# +# 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 ""; + +#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 and dos. Add extra tests here as needed. +my $s=":"; +if(($^O eq "MSWin32") || ($^O eq "dos")) + { + $s=";"; + } + +#build up standard classpath +my $localpath=$ENV{CLASSPATH}; +if ($localpath eq "") + { + print "warning: no initial classpath\n" if ($debug); + $localpath=""; + } + +#add jar files. I am sure there is a perl one liner to do this. +my $jarpattern="$HOME/lib/*.jar"; +my @jarfiles =glob($jarpattern); +print "jarfiles=@jarfiles\n" if ($debug); +my $jar; +foreach $jar (@jarfiles ) + { + $localpath.="$s$jar"; + } + +#if Java home is defined, look for tools.jar & classes.zip and add to classpath +my $JAVA_HOME = $ENV{JAVA_HOME}; +if ($JAVA_HOME ne "") + { + my $tools="$JAVA_HOME/lib/tools.jar"; + if (-e "$tools") + { + $localpath .= "$s$tools"; + } + my $classes="$JAVA_HOME/lib/classes.zip"; + if (-e $classes) + { + $localpath .= "$s$classes"; + } + } +else + { + print "\n\nWarning: JAVA_HOME environment variable is not set.\n". + "If the build fails because sun.* classes could not be found\n". + "you will need to set the JAVA_HOME environment variable\n". + "to the installation directory of java\n"; + } + +#jikes +my @ANT_OPTS=split $ENV{ANT_OPTS}; +if($ENV{JIKESPATH} ne "") + { + push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}"; + } + +#construct arguments to java + +my @ARGS; +push @ARGS, "-classpath", "$localpath", "-Dant.home=$HOME"; +push @ARGS, @ANT_OPTS; +push @ARGS, "org.apache.tools.ant.Main"; +push @ARGS, @ARGV; + +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; + } diff --git a/tools/centipede/lib/VERSIONS b/tools/centipede/lib/VERSIONS new file mode 100644 index 000000000..84611d6a3 --- /dev/null +++ b/tools/centipede/lib/VERSIONS @@ -0,0 +1,3 @@ +xalan-2.2.0.jar +xerces-2.0.0.jar +junit-3.7.jar \ No newline at end of file diff --git a/tools/centipede/src/java/ClassAvailableTask.java b/tools/centipede/src/java/ClassAvailableTask.java new file mode 100644 index 000000000..77d4cf1ad --- /dev/null +++ b/tools/centipede/src/java/ClassAvailableTask.java @@ -0,0 +1,159 @@ +/***************************************************************************** + * Copyright (C) The Apache Software Foundation. All rights reserved. * + * ------------------------------------------------------------------------- * + * This software is published under the terms of the Apache Software License * + * version 1.1, a copy of which has been included with this distribution in * + * the LICENSE file. * + *****************************************************************************/ + +import java.io.*; +import java.util.*; +import java.util.zip.*; +import org.apache.tools.ant.*; +import org.apache.tools.ant.taskdefs.*; +import org.apache.tools.ant.types.*; + +/** + * Will set the given property if the requested class is available in the + * specified classpath. The found class is not loaded! + * This class is heavily based on the available task in the ant package: + * @author Stefano Mazzocchi stefano@apache.org + * + * This task searches only in the defined path but not in the parents path + * unless explicitly overridden by the value of ${build.sysclasspath} + * like the original available task does. + * @author Carsten Ziegeler + * @version CVS $Revision$ $Date$ + */ + +public class ClassAvailableTask extends Task { + + /** + * A hashtable of zip files opened by the classloader + */ + private Hashtable zipFiles = new Hashtable(); + + private String property; + private String classname; + private Path classpath; + private String value = "true"; + + public void setClasspath(Path classpath) { + createClasspath().append(classpath); + } + + public Path createClasspath() { + if (this.classpath == null) { + this.classpath = new Path(this.project); + } + return this.classpath.createPath(); + } + + public void setClasspathRef(Reference r) { + createClasspath().setRefid(r); + } + + public void setProperty(String property) { + this.property = property; + } + + public void setValue(String value) { + this.value = value; + } + + public void setClassname(String classname) { + if (!"".equals(classname)) { + this.classname = classname; + } + } + + public void execute() throws BuildException { + if (property == null) { + throw new BuildException("property attribute is required", location); + } + + if (eval()) { + this.project.setProperty(property, value); + } + } + + public boolean eval() throws BuildException { + if (classname == null) { + throw new BuildException("At least one of (classname|file|resource) is required", location); + } + + if (classpath != null) { + classpath.setProject(project); + classpath = classpath.concatSystemClasspath("ignore"); + } + + if (!findClassInComponents(classname)) { + log("Unable to load class " + classname + " to set property " + property, Project.MSG_VERBOSE); + return false; + } + + return true; + } + + /** + * Get an inputstream to a given resource in the given file which may + * either be a directory or a zip file. + * + * @param file the file (directory or jar) in which to search for the resource. + * @param resourceName the name of the resource for which a stream is required. + * + * @return a stream to the required resource or null if the resource cannot be + * found in the given file object + */ + private boolean contains(File file, String resourceName) { + try { + if (!file.exists()) { + return false; + } + + if (file.isDirectory()) { + File resource = new File(file, resourceName); + + if (resource.exists()) { + return true; + } + } + else { + // is the zip file in the cache + ZipFile zipFile = (ZipFile)zipFiles.get(file); + if (zipFile == null) { + zipFile = new ZipFile(file); + zipFiles.put(file, zipFile); + } + ZipEntry entry = zipFile.getEntry(resourceName); + if (entry != null) { + return true; + } + } + } + catch (Exception e) { + log("Ignoring Exception " + e.getClass().getName() + ": " + e.getMessage() + + " reading resource " + resourceName + " from " + file, Project.MSG_VERBOSE); + } + + return false; + } + + /** + * Find a class on the given classpath. + */ + private boolean findClassInComponents(String name) { + // we need to search the components of the path to see if we can find the + // class we want. + final String classname = name.replace('.', '/') + ".class"; + final String[] list = classpath.list(); + boolean found = false; + int i = 0; + while (i < list.length && found == false) { + final File pathComponent = (File)project.resolveFile(list[i]); + found = this.contains(pathComponent, classname); + i++; + } + return found; + } +} diff --git a/tools/centipede/src/java/IZPressHtmlCompressTask.java b/tools/centipede/src/java/IZPressHtmlCompressTask.java new file mode 100644 index 000000000..3dabacd0e --- /dev/null +++ b/tools/centipede/src/java/IZPressHtmlCompressTask.java @@ -0,0 +1,179 @@ +/***************************************************************************** + * Copyright (C) The Krysalis project. All rights reserved. * + * ------------------------------------------------------------------------- * + * This software is published under the terms of the Krysalis Patchy * + * Software License version 1.1_01, a copy of which has been included * + * at the bottom of this file. * + *****************************************************************************/ + +import com.izforge.izpress.*; + +import java.io.InputStream; +import java.io.FileInputStream; +import java.io.BufferedInputStream; +import java.io.OutputStream; +import java.io.FileOutputStream; +import java.io.Writer; +import java.io.PrintWriter; +import java.io.FileWriter; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; + +import java.util.ArrayList; + +import org.w3c.dom.NodeList; +import org.w3c.dom.Node; +import org.w3c.dom.Element; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; + +import org.w3c.tidy.Tidy; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.taskdefs.Property; + +/** + * Task to compress html size. + * + * @author Nicola Ken Barozzi + * @created 14 January 2002 + */ +public class IZPressHtmlCompressTask extends org.apache.tools.ant.Task { + + private String src; + private String dest; + private Compressor compressor; + private CompressorConfig conf; + private String wipeComments = "true"; + private String wipeBorders = "true"; + private String wipeReturns = "true"; + private String wipeSpaces = "true"; + + PrintWriter pw; + /** + * Constructor. + */ + public IZPressHtmlCompressTask() { + super(); + } + + /** + * Initializes the task. + */ + public void init() { + super.init(); + // Setup an instance of IZCompressor. + conf = + new CompressorConfig(false,false,true,true); + } + + /** + * Run the task. + * @exception org.apache.tools.ant.BuildException The exception raised during task execution. + */ + public void execute() throws org.apache.tools.ant.BuildException { + + try{ + + FileInputStream in = new FileInputStream(src); + FileOutputStream out = new FileOutputStream(dest); + + compressor = new Compressor(in,out,conf); + + compressor.compress(); + + out.flush(); + in.close(); + out.close(); + + } + catch(IOException ioe) + { + throw new BuildException(ioe); + } + } + + public void setSrc(String src) { + this.src = src; + } + + public void setDest(String dest) { + this.dest = dest; + } + + + public void setWipeComments(String wipeComments) { + this.wipeComments = wipeComments; + } + + + public void setWipeBorders(String wipeBorders) { + this.wipeBorders = wipeBorders; + } + + public void setWipeReturns(String wipeReturns) { + this.wipeReturns = wipeReturns; + } + + + public void setWipeSpaces(String wipeSpaces) { + this.wipeSpaces = wipeSpaces; + } + +} + +/* +The Krysalis Patchy Software License, Version 1.1_01 +Copyright (c) 2002 Nicola Ken Barozzi. All rights reserved. + +This Licence is compatible with the BSD licence as described and +approved by http://www.opensource.org/, and is based on the +Apache Software Licence Version 1.1. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. The end-user documentation included with the redistribution, + if any, must include the following acknowledgment: + "This product includes software developed for project + Krysalis (http://www.krysalis.org/)." + Alternately, this acknowledgment may appear in the software itself, + if and wherever such third-party acknowledgments normally appear. + +4. The names "Krysalis" and "Nicola Ken Barozzi" and + "Krysalis Centipede" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact krysalis@nicolaken.org. + +5. Products derived from this software may not be called "Krysalis", + "Krysalis Centipede", nor may "Krysalis" appear in their name, + without prior written permission of Nicola Ken Barozzi. + +6. This software may contain voluntary contributions made by many + individuals, who decided to donate the code to this project in + respect of this licence. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE KRYSALIS PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +====================================================================*/ diff --git a/tools/centipede/src/java/JTidyTask.java b/tools/centipede/src/java/JTidyTask.java new file mode 100644 index 000000000..349a2d1b7 --- /dev/null +++ b/tools/centipede/src/java/JTidyTask.java @@ -0,0 +1,279 @@ +/***************************************************************************** + * Copyright (C) The Krysalis project. All rights reserved. * + * ------------------------------------------------------------------------- * + * This software is published under the terms of the Krysalis Patchy * + * Software License version 1.1_01, a copy of which has been included * + * at the bottom of this file. * + *****************************************************************************/ + +import java.io.InputStream; +import java.io.FileInputStream; +import java.io.BufferedInputStream; +import java.io.OutputStream; +import java.io.FileOutputStream; +import java.io.Writer; +import java.io.PrintWriter; +import java.io.FileWriter; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; + +import java.util.ArrayList; + +import org.w3c.dom.NodeList; +import org.w3c.dom.Node; +import org.w3c.dom.Element; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.tidy.Tidy; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.taskdefs.Property; + +/** + * Task to ask property values to the user. Uses current value as default. + * + * @author Nicola Ken Barozzi + * @created 14 January 2002 + */ + +public class JTidyTask + extends org.apache.tools.ant.Task +{ + private String src; + private String dest; + private String log; + private Tidy tidy; + private String warn = "false"; + private String summary = "false"; + PrintWriter pw; + + /** + * Constructor. + */ + + public JTidyTask() + { + super(); + } + + /** + * Initializes the task. + */ + + public void init() + { + super.init(); + + // Setup an instance of Tidy. + tidy = new Tidy(); + tidy.setXmlOut(true); + tidy.setXHTML(true); + tidy.setDropFontTags(true); + tidy.setLiteralAttribs(true); + tidy.setMakeClean(true); + tidy.setShowWarnings(Boolean.getBoolean(warn)); + tidy.setQuiet(!Boolean.getBoolean(summary)); + } + + /** + * Run the task. + * @exception org.apache.tools.ant.BuildException The exception raised during task execution. + */ + + public void execute() + throws org.apache.tools.ant.BuildException + { + try + { + PrintWriter pw = new PrintWriter(new FileWriter(log)); + + tidy.setErrout(pw); + + // Extract the document using JTidy and stream it. + BufferedInputStream in = + new BufferedInputStream(new FileInputStream(src)); + + // FileOutputStream out = new FileOutputStream(dest); + PrintWriter out = + new PrintWriter(new FileWriter(dest)); + + // using null as output to get dom so to remove duplicate attributes + org.w3c.dom.Document domDoc = tidy.parseDOM(in, null); + + domDoc.normalize(); + stripDuplicateAttributes(domDoc, null); + org.apache.xml.serialize.OutputFormat format = + new org.apache.xml.serialize.OutputFormat(); + + format.setIndenting(true); + format.setEncoding("ISO-8859-1"); + format.setPreserveSpace(true); + format.setLineSeparator("\n"); + org.apache.xml.serialize.XMLSerializer serializer = + new org.apache.xml.serialize.XMLSerializer(out, format); + + serializer.serialize(domDoc); + out.flush(); + out.close(); + in.close(); + pw.flush(); + pw.close(); + } + catch (IOException ioe) + { + throw new BuildException(ioe); + } + } + + public void setSrc(String src) + { + this.src = src; + } + + public void setDest(String dest) + { + this.dest = dest; + } + + public void setLog(String log) + { + this.log = log; + } + + public void setWarn(String warn) + { + this.warn = warn; + } + + public void setSummary(String summary) + { + this.summary = summary; + } + + // using parent because jtidy dom is bugged, cannot get parent or delete child + public static void stripDuplicateAttributes(Node node, Node parent) + { + + // The output depends on the type of the node + switch (node.getNodeType()) + { + + case Node.DOCUMENT_NODE : + { + Document doc = ( Document ) node; + Node child = doc.getFirstChild(); + + while (child != null) + { + stripDuplicateAttributes(child, node); + child = child.getNextSibling(); + } + break; + } + case Node.ELEMENT_NODE : + { + Element elt = ( Element ) node; + NamedNodeMap attrs = elt.getAttributes(); + ArrayList nodesToRemove = new ArrayList(); + int nodesToRemoveNum = 0; + + for (int i = 0; i < attrs.getLength(); i++) + { + Node a = attrs.item(i); + + for (int j = 0; j < attrs.getLength(); j++) + { + Node b = attrs.item(j); + + // if there are two attributes with same name + if ((i != j) + && (a.getNodeName().equals(b.getNodeName()))) + { + nodesToRemove.add(b); + nodesToRemoveNum++; + } + } + } + for (int i = 0; i < nodesToRemoveNum; i++) + { + org.w3c.dom.Attr nodeToDelete = + ( org.w3c.dom.Attr ) nodesToRemove.get(i); + org.w3c.dom.Element nodeToDeleteParent = + ( org.w3c.dom + .Element ) node; // nodeToDelete.getParentNode(); + + nodeToDeleteParent.removeAttributeNode(nodeToDelete); + } + nodesToRemove.clear(); + Node child = elt.getFirstChild(); + + while (child != null) + { + stripDuplicateAttributes(child, node); + child = child.getNextSibling(); + } + break; + } + default : + + // do nothing + break; + } + } +} + +/* +The Krysalis Patchy Software License, Version 1.1_01 +Copyright (c) 2002 Nicola Ken Barozzi. All rights reserved. + +This Licence is compatible with the BSD licence as described and +approved by http://www.opensource.org/, and is based on the +Apache Software Licence Version 1.1. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. The end-user documentation included with the redistribution, + if any, must include the following acknowledgment: + "This product includes software developed for project + Krysalis (http://www.krysalis.org/)." + Alternately, this acknowledgment may appear in the software itself, + if and wherever such third-party acknowledgments normally appear. + +4. The names "Krysalis" and "Nicola Ken Barozzi" and + "Krysalis Centipede" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact krysalis@nicolaken.org. + +5. Products derived from this software may not be called "Krysalis", + "Krysalis Centipede", nor may "Krysalis" appear in their name, + without prior written permission of Nicola Ken Barozzi. + +6. This software may contain voluntary contributions made by many + individuals, who decided to donate the code to this project in + respect of this licence. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE KRYSALIS PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +====================================================================*/ diff --git a/tools/centipede/src/java/UserInputTask.java b/tools/centipede/src/java/UserInputTask.java new file mode 100644 index 000000000..58d52154c --- /dev/null +++ b/tools/centipede/src/java/UserInputTask.java @@ -0,0 +1,91 @@ +/***************************************************************************** + * Copyright (C) The Apache Software Foundation. All rights reserved. * + * ------------------------------------------------------------------------- * + * This software is published under the terms of the Apache Software License * + * version 1.1, a copy of which has been included with this distribution in * + * the LICENSE file. * + *****************************************************************************/ + +import java.io.InputStreamReader; +import java.io.BufferedReader; +import java.io.IOException; +import org.apache.tools.ant.taskdefs.Property; + +/** + * Task to ask property values to the user. Uses current value as default. + * + * @author Nicola Ken Barozzi + * @created 14 January 2002 + * @version CVS $Revision$ $Date$ + */ +public class UserInputTask extends org.apache.tools.ant.Task { + + private String question; + private String name; + private String value; + + /** + * Constructor. + */ + public UserInputTask() { + super(); + } + + /** + * Initializes the task. + */ + public void init() { + super.init(); + question = "?"; + } + + /** + * Run the task. + * @exception org.apache.tools.ant.BuildException The exception raised during task execution. + */ + public void execute() throws org.apache.tools.ant.BuildException { + value = project.getProperty(name); + String defaultvalue = value; + + //if the property exists + if (value != null) { + + System.out.println("\n"+question + " ["+value + "] "); + + BufferedReader reader = new BufferedReader(new InputStreamReader (System.in)); + + try + { + value = reader.readLine(); + } + catch (IOException e) + { + value = defaultvalue; + } + + if (!value.equals("")) { + project.setProperty(name, value); + } else { + project.setProperty(name, defaultvalue); + } + } + } + + /** + * Sets the prompt text that will be presented to the user. + * @param prompt String + */ + public void addText(String question) { + this.question=question; + } + + public void setQuestion(String question) { + this.question = question; + } + + public void setName(String name) { + this.name = name; + } + +} + diff --git a/tools/centipede/src/java/XmlPropertyTask.java b/tools/centipede/src/java/XmlPropertyTask.java new file mode 100644 index 000000000..465245a21 --- /dev/null +++ b/tools/centipede/src/java/XmlPropertyTask.java @@ -0,0 +1,226 @@ +/***************************************************************************** + * Copyright (C) The Krysalis project. All rights reserved. * + * ------------------------------------------------------------------------- * + * This software is published under the terms of the Krysalis Patchy * + * Software License version 1.1_01, a copy of which has been included * + * at the bottom of this file. * + *****************************************************************************/ + +import java.io.InputStream; +import java.io.FileInputStream; +import java.io.BufferedInputStream; +import java.io.OutputStream; +import java.io.FileOutputStream; +import java.io.Writer; +import java.io.PrintWriter; +import java.io.FileWriter; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; + +import java.util.ArrayList; + +import org.w3c.dom.NodeList; +import org.w3c.dom.Node; +import org.w3c.dom.Element; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.DOMException; +import org.w3c.dom.NamedNodeMap; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.FactoryConfigurationError; +import javax.xml.parsers.ParserConfigurationException; + +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.taskdefs.Property; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.taskdefs.Property; + +import org.apache.tools.ant.Task; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.ProjectHelper; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Reference; + +/** + * Task get property values from a valid xml file. + * Example: + * + * Text + * <2><3><4>false + * + * + * xml.root-tag.myattr=true + * xml.root-tag.inner-tag=Text + * xml.root-tag.2.3.4=false + * + * @author Nicola Ken Barozzi + * @created 14 January 2002 + */ + +public class XmlPropertyTask extends org.apache.tools.ant.Task +{ + private String src; + private org.w3c.dom.Document document; + + /** + * Constructor. + */ + public XmlPropertyTask() + { + super(); + } + + /** + * Initializes the task. + */ + + public void init() + { + super.init(); + } + + /** + * Run the task. + * @exception org.apache.tools.ant.BuildException The exception raised during task execution. + */ + public void execute() + throws org.apache.tools.ant.BuildException + { + BufferedInputStream configurationStream = null; + + try + { + configurationStream = + new BufferedInputStream(new FileInputStream(src)); + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + + factory.setValidating(false); + factory.setNamespaceAware(false); + + DocumentBuilder builder = factory.newDocumentBuilder(); + document = builder.parse( configurationStream ); + + addNodeRecursively(document.getDocumentElement(),"xml"); + + } catch (SAXException sxe) { + // Error generated during parsing + Exception x = sxe; + if (sxe.getException() != null) + x = sxe.getException(); + throw new BuildException(x); + + } catch (ParserConfigurationException pce) { + // Parser with specified options can't be built + throw new BuildException(pce); + } catch (IOException ioe) { + // I/O error + throw new BuildException(ioe); + } + finally + { + if(configurationStream!=null){ + try{configurationStream.close();}catch(Exception e){}} + } + } + + + void addNodeRecursively(org.w3c.dom.Node node, String text) { + + if (node.hasAttributes()) { + org.w3c.dom.NamedNodeMap nodeAttributes = node.getAttributes(); + for (int i = 0; i < nodeAttributes.getLength(); i++) { + Node attributeNode = nodeAttributes.item(i); + String attributeName = text+"."+node.getNodeName()+"."+attributeNode.getNodeName(); + String attributeValue = attributeNode.getNodeValue(); + log(attributeName+":"+attributeValue, Project.MSG_VERBOSE); + project.setUserProperty(attributeName,attributeValue); + } + } + + if(node.getNodeType()==Node.TEXT_NODE){ + String nodeText = node.getNodeValue(); + if(nodeText.trim().length()!=0) + { + log(text+":"+nodeText, Project.MSG_VERBOSE); + project.setUserProperty(text,nodeText); + } + } + + if (node.hasChildNodes()) { + text+=("."+node.getNodeName()); + org.w3c.dom.NodeList nodeChildren = node.getChildNodes(); + for (int i = 0; i < nodeChildren.getLength(); i++) { + addNodeRecursively(nodeChildren.item(i), text); + } + } + } + + public void setFile(String src) + { + this.src = src; + } +} + + +/* +The Krysalis Patchy Software License, Version 1.1_01 +Copyright (c) 2002 Nicola Ken Barozzi. All rights reserved. + +This Licence is compatible with the BSD licence as described and +approved by http://www.opensource.org/, and is based on the +Apache Software Licence Version 1.1. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. The end-user documentation included with the redistribution, + if any, must include the following acknowledgment: + "This product includes software developed for project + Krysalis (http://www.krysalis.org/)." + Alternately, this acknowledgment may appear in the software itself, + if and wherever such third-party acknowledgments normally appear. + +4. The names "Krysalis" and "Nicola Ken Barozzi" and + "Krysalis Centipede" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact krysalis@nicolaken.org. + +5. Products derived from this software may not be called "Krysalis", + "Krysalis Centipede", nor may "Krysalis" appear in their name, + without prior written permission of Nicola Ken Barozzi. + +6. This software may contain voluntary contributions made by many + individuals, who decided to donate the code to this project in + respect of this licence. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE KRYSALIS PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +====================================================================*/ diff --git a/tools/centipede/src/resources/Release-Checklist.txt b/tools/centipede/src/resources/Release-Checklist.txt new file mode 100644 index 000000000..61ebae582 --- /dev/null +++ b/tools/centipede/src/resources/Release-Checklist.txt @@ -0,0 +1,18 @@ +- build distributions +- sign distributions +- Generate announcements and HEADER.html +- upload distributions to correct dir +- tag CVS +- generate www pages and upload +- bump release ID +- send announcements to announcement@apache.org, announcements@xml.apache.org, announcements@jakarta.apache.org +- news to newsgroups: comp.lang.java.softwaretools +- post stories on + *) jakarta news page + *) theserverside.com + *) freshmeat.net + *) www.javaworld.com + *) www.javalobby.com + *) www.jguru.com + *) www.slashdot.org + (and follow them up) diff --git a/tools/centipede/src/resources/stylesheets/announcement2readme.xsl b/tools/centipede/src/resources/stylesheets/announcement2readme.xsl new file mode 100644 index 000000000..63cbdefd0 --- /dev/null +++ b/tools/centipede/src/resources/stylesheets/announcement2readme.xsl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + +

PGP Signatures

+ +

Many of the distribution kits have been digitally signed (using + PGP). If so, there will be an accompanying + distribution.asc file in the same directory as + the distribution. The PGP keys can be found in the distribution + directory at < + http://jakarta.apache.org/builds/jakarta-avalon/release/KEYS>.

+ + --bin.tar.gz + +
Always test available signatures, e.g.,
+> pgpk -a KEYS
+> pgpv .asc
+or,
+> pgp -ka KEYS
+> pgp .asc
+or,
+> gpg --import KEYS
+> gpg --verify .asc
+
+ + + +

About

+ +
+
+ +
+ + + +

For more information about , please go to + + .

+ + + +

ChangeLog for

+ +
+
+ + + + + + +
    + +
  • + + + [] + +
  • +
    +
+
+ +
diff --git a/tools/centipede/src/resources/stylesheets/announcement2txt.xsl b/tools/centipede/src/resources/stylesheets/announcement2txt.xsl new file mode 100644 index 000000000..9b03cc12b --- /dev/null +++ b/tools/centipede/src/resources/stylesheets/announcement2txt.xsl @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Released + + + + + + + + + + + About + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +For more information about + + , please go to + + + + + + + +ChangeLog for + + + + + + + + + + +Downloads for available at + +/latest + + + + + + + + + + + + + ( + + ) + + + + + *) + + + + + + [] + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/centipede/src/resources/stylesheets/bugzilla2patchqueue.xsl b/tools/centipede/src/resources/stylesheets/bugzilla2patchqueue.xsl new file mode 100644 index 000000000..96e91245a --- /dev/null +++ b/tools/centipede/src/resources/stylesheets/bugzilla2patchqueue.xsl @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + http://nagoya.apache.org/bugzilla/ + + + + + + + + + + + + + + + + + + + diff --git a/tools/centipede/src/resources/stylesheets/changelog.xsl b/tools/centipede/src/resources/stylesheets/changelog.xsl new file mode 100644 index 000000000..20f7cf9fb --- /dev/null +++ b/tools/centipede/src/resources/stylesheets/changelog.xsl @@ -0,0 +1,95 @@ + + + + + + module + cvsweb + + + + + + + + +

Change Log

+ + + + + + + + +
+ + + +

+ + + +

+

+ + + by + +

+

+ +

+
+ +
+ + + + + + + + + + + + + + +
+ + + /?rev=&content-type=text/x-cvsweb-markup + + + /?r1=&r2=&diff_format=h + + + + +
+ + + + + + + + + +
+ + + + + +
+ + + +
+
+ +
+ diff --git a/tools/centipede/src/resources/stylesheets/patchqueue2text4dev.xsl b/tools/centipede/src/resources/stylesheets/patchqueue2text4dev.xsl new file mode 100644 index 000000000..57986547c --- /dev/null +++ b/tools/centipede/src/resources/stylesheets/patchqueue2text4dev.xsl @@ -0,0 +1,70 @@ + + + + + + + ----------------------------------------------------------- + This mail is generated automatically using + Jakarta Ant. Contents are automatically + downloaded from Apache's Bugzilla. +----------------------------------------------------------- + Please do not reply to this mail. +----------------------------------------------------------- + +*********************************************************** + __ __ __ __ __ __ + (___ (__) (___ (__) (__) | ) + + __ __ _|_ __ |__ ___ __ + |__) (__( |_, (___ | ) (__/_ __) + | +*********************************************************** +***************** patches in queue: ******************** +*********************************************************** + +----------------------------------------------------------- +: +----------------------------------------------------------- + + +REVIEWER: +RESOLUTION: +STATUS: + + + +*************************that's it!************************ + +------------------------patch HOWTO------------------------ + +Send patches to http://nagoya.apache.org/bugzilla/ +specifying [PATCH] in the summary. +Bugzilla sends a mail automatically to this list. +Reviewers will mark it FIXED there when applied. +Patches not sent to Bugzilla will not be reviewed. +----------------------------------------------------------- +This file is generated and updated automatically at least +once a week, and the data is taken from Bugzilla. +If you don't find the patch you submitted to bugzilla +after one week, please notify cocoon-dev@xml.apache.org +for assistance. +----------------------------------------------------------- +There is usually a HEAD branch and a previous-version +branch that are maintained. Where will the patch go? +1. If it is a bug fix it should go to both branches +2. If something is totally new it goes into HEAD scratchpad. +3. Something in between, but does not break backward + compatibility _may_ go into both (and may not) +4. For everything else, a vote is required so + first it may go into HEAD, and then be VOTEd in order + to sync this into branch. +Please note that structural changes have to be VOTEd first. + + + + + + + diff --git a/tools/centipede/src/resources/stylesheets/patchqueue2xdocs.xsl b/tools/centipede/src/resources/stylesheets/patchqueue2xdocs.xsl new file mode 100644 index 000000000..37194957b --- /dev/null +++ b/tools/centipede/src/resources/stylesheets/patchqueue2xdocs.xsl @@ -0,0 +1,109 @@ + + + + + + + + + + ]]> + + + +
+ Patch Queue + + + + +
+ + + + + +

+ This is an informal list - in chronological order - + of some of the noteworthy patches that have been posted + to the cocoon-dev mailing list. + These patches are not (yet) part of the Apache Cocoon project, but need reviewing for possible + inclusion. This system was instituted because, due to the large volume of mail and + the lack of time of the committers, some patches tended to get forgotten about. This + queue does not guarantee that any patch will be reviewed within a reasonable time frame, + but it does at least make them easier to find! +

+ +

Reviewers wanted! - If you have time to review and/or test these patches, + we would be grateful for your time. Please post comments to the cocoon-dev mailing lists. +

+ +

+ Before submitting a patch, please read the page on Third-Party + Contributions. The preferred submission method for patches is: +

+ +
    +
  • Post to cocoon-dev@xml.apache.org
  • +
  • Describe the patch, the reason for it and (if necessary) why this is important.
  • +
  • Generate the patch in diff -u format from CVS
  • +
  • Also generate a documentation patch or new file, if this is something that should be documented. +
  • +
  • Post as an attachment rather than inline (unless it is trivially small).
  • +
+ +

Following the above guidelines will facilitate your patch being reviewed + and applied efficiently.

+ +
+ + + +

[Under Construction] Archive links will be added later. + Please do not bother the patch submitters/authors without first reading the + relevant post(s) in the mailing list archives. +

+ +

Vapourware will not be listed.

+ + + + + + + + + + + + + + + + + + +
idSummaryReviewerResolutionStatus
+ + + + +
+ +

See also additional list of patches to be added in To Do. +

+ +
+ +
+ +
+ + + + + +
diff --git a/tools/centipede/targets/compile.xtarget b/tools/centipede/targets/compile.xtarget new file mode 100644 index 000000000..416c9f538 --- /dev/null +++ b/tools/centipede/targets/compile.xtarget @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/centipede/targets/dev.xtarget b/tools/centipede/targets/dev.xtarget new file mode 100644 index 000000000..ea6c997ff --- /dev/null +++ b/tools/centipede/targets/dev.xtarget @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ********************************************** + * + * Build all distributions: + * - source distribution for windows/unix. + * - binary distribution for windows/unix. + * + * This may take a while... + * + *********************************************** + + + + + diff --git a/tools/centipede/targets/docs.xtarget b/tools/centipede/targets/docs.xtarget new file mode 100644 index 000000000..c426c3047 --- /dev/null +++ b/tools/centipede/targets/docs.xtarget @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +