[pkg-java] r11606 - in trunk/ant/debian: . patches
Ludovic Claude
ludovicc-guest at alioth.debian.org
Tue Feb 16 21:19:57 UTC 2010
Author: ludovicc-guest
Date: 2010-02-16 21:19:57 +0000 (Tue, 16 Feb 2010)
New Revision: 11606
Added:
trunk/ant/debian/README.source
trunk/ant/debian/orig-tar.sh
trunk/ant/debian/patches/ant-source-target-version.patch
trunk/ant/debian/patches/ant_add_xerces.patch
trunk/ant/debian/patches/ant_home_path.patch
trunk/ant/debian/patches/ant_native2ascii.patch
trunk/ant/debian/patches/build-path.patch
trunk/ant/debian/patches/gjdoc_task.patch
trunk/ant/debian/patches/javadoc_maxmemory.patch
trunk/ant/debian/patches/no_test-jars.patch
trunk/ant/debian/patches/series
Removed:
trunk/ant/debian/patches/01_ant_home_path.patch
trunk/ant/debian/patches/01_gjdoc_task.patch
trunk/ant/debian/patches/01_javadoc_maxmemory.patch
trunk/ant/debian/patches/02_ant_add_xerces.patch
trunk/ant/debian/patches/03_SplashTaskPatch_a.patch
trunk/ant/debian/patches/04_no_test-jars.patch
trunk/ant/debian/patches/06_ant-source-target-version.patch
trunk/ant/debian/patches/10_ant_native2ascii.patch
trunk/ant/debian/patches/11_ant_underscore_dash_fix.patch
Modified:
trunk/ant/debian/README.Debian
trunk/ant/debian/ant-optional.poms
trunk/ant/debian/ant.1
trunk/ant/debian/build.xml.5
trunk/ant/debian/changelog
trunk/ant/debian/control
trunk/ant/debian/rules
trunk/ant/debian/watch
Log:
* New upstream version
(Closes: #567229, #330292, #514140, #569936, #570075)
* Add myself to Uploaders
* Bump up Standards-Version to 3.8.4, no changes
* debian/control: update ant Depends and remove old
java1-runtime-headless, add new java5-runtime-headless and
java6-runtime-headless
* Demote ant-gcj from Recommends to Suggests for package ant
(Closes: #559058)
* Fix documentation for ant-optional-gcj (Closes: #563760)
* Update man page ant.1 and build.xml.5: fix Lintian warnings
and update the documentation
* Move the patch system to quilt, delete old patches
(11_ant_underscore_dash_fix.patch, 03_SplashTaskPatch_a.patch),
refresh all patches
* Add tasks for stylebook and xalan2
* Add debian/orig_tar.sh and use it to repack the archive without
compiled jars and pdf files
Modified: trunk/ant/debian/README.Debian
===================================================================
--- trunk/ant/debian/README.Debian 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/README.Debian 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,4 +1,4 @@
-Ant 1.7 for Debian
+Ant 1.8 for Debian
==================
All JAR archives in /usr/share/ant/lib/ are appended to the classpath
Added: trunk/ant/debian/README.source
===================================================================
--- trunk/ant/debian/README.source (rev 0)
+++ trunk/ant/debian/README.source 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,9 @@
+Patch System
+============
+
+This package uses quilt to manage all modifications to the upstream
+source. Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+See /usr/share/doc/quilt/README.source for a detailed explanation.
+
Modified: trunk/ant/debian/ant-optional.poms
===================================================================
--- trunk/ant/debian/ant-optional.poms 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/ant-optional.poms 2010-02-16 21:19:57 UTC (rev 11606)
@@ -6,6 +6,7 @@
src/etc/poms/ant-apache-oro/pom.xml
src/etc/poms/ant-apache-regexp/pom.xml
src/etc/poms/ant-apache-resolver/pom.xml
+src/etc/poms/ant-apache-xalan2/pom.xml
src/etc/poms/ant-commons-logging/pom.xml
src/etc/poms/ant-commons-net/pom.xml
src/etc/poms/ant-javamail/pom.xml
Modified: trunk/ant/debian/ant.1
===================================================================
--- trunk/ant/debian/ant.1 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/ant.1 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,4 +1,4 @@
-.TH ant 1 "June 2005" "Debian/GNU Linux"
+.TH ant 1 "Feb 2010" "Debian GNU/Linux"
.SH NAME
ant \- a Java based make tool.
@@ -59,6 +59,9 @@
\fB\-listener\fR <\fIclassname\fR>
add an instance of the given class as a project listener
.TP
+\fB\-noinput\fR
+do not allow interactive input
+.TP
\fB\-buildfile, \-file, \-f\fR <\fIfile\fR>
use the given buildfile instead of the default
.B build.xml
@@ -70,17 +73,36 @@
\fB\-D\fR<\fIproperty\fR>=<\fIvalue\fR>
use value for the given property
.TP
+\fB\-keep-going, \-k\fR
+execute all targets that do not depend on failed target(s)
+.TP
\fB\-propertyfile\fR <\fIname\fR>
load all properties from file with \-D properties taking precedence
.TP
\fB\-inputhandler\fR <\fIclass\fR>
the class which will handle input requests
.TP
+\fB\-find, \-s\fR <\fIfile\fR>
+search for buildfile towards the root of the filesystem and use it
+.TP
\fB\-nice\fR <\fInumber\fR>
A niceness value for the main thread: 1 (lowest) to 10 (highest); 5 is the default
+.TP
+\fB\-nouserlib\fR
+Run ant without using the jar files from ${user.home}/.ant/lib
+.TP
+\fB\-noclasspath\fR
+Run ant without using CLASSPATH
+.TP
+\fB\-autoproxy\fR
+Java 1.5+ : use the OS proxies
+.TP
+\fB\-main\fR <\fIclass\fR>
+Override Ant's normal entry point
.SH SEE ALSO
.BR make (1)
+.BR mvn (1)
.SH AUTHOR
This manpage is written by Egon Willighagen <egonw at sci.kun.nl>
Modified: trunk/ant/debian/build.xml.5
===================================================================
--- trunk/ant/debian/build.xml.5 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/build.xml.5 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,4 +1,4 @@
-.TH build.xml 5 "June 2005" "Debian/GNU Linux"
+.TH build.xml 5 "February 2010" "Debian GNU/Linux"
.SH NAME
build.xml \- configuration file used by ant to build projects
@@ -13,7 +13,7 @@
The format of
.B ant
-is XML and for each project a seperate file is constructed.
+is XML and for each project a separate file is constructed.
The buildfile consists of one or more tasks. An example is
given below.
@@ -45,20 +45,25 @@
.B Built-in tasks
The built-in tasks are: \fIAnt\fR, \fIAntCall\fR, \fIAntStructure\fR,
-\fIApply\fR, \fIAvailable\fR, \fIBasename\fR, \fIBuildNumber\fR,
-\fIBUnzip2\fR, \fIBZip2\fR, \fIChecksum\fR, \fIChmod\fR, \fIConcat\fR,
-\fICondition\fR, \fICopy\fR, \fICvs\fR, \fIDelete\fR, \fIDeltree\fR,
-\fIDirname\fR, \fIEar\fR, \fIEcho\fR, \fIExec\fR, \fIFail\fR, \fIFilter\fR,
-\fIFixCRLF\fR, \fIGenKey\fR, \fIGet\fR, \fIGUnzip\fR, \fIGZip\fR,
-\fIImport\fR, \fIInput\fR, \fIJar\fR, \fIJava\fR, \fIJavac\fR,
-\fIJavadoc\fR, \fILength\fR, \fILoadFile\fR, \fILoadProperties\fR,
-\fIMail\fR, \fIMkdir\fR, \fIMove\fR, \fINice\fR, \fIParallel\fR,
-\fIPatch\fR, \fIPathConvert\fR, \fIProperty\fR, \fIRecord\fR,
-\fIReplace\fR, \fIRmic\fR, \fISequential\fR, \fISignJar\fR, \fISleep\fR,
-\fISql\fR, \fIStyle\fR, \fISubant\fR, \fISync\fR, \fITar\fR, \fITaskdef\fR,
-\fITempfile\fR, \fITouch\fR, \fITStamp\fR, \fITypedef\fR, \fIUnjar\fR,
-\fIUntar\fR, \fIUnwar\fR, \fIUnzip\fR, \fIUptodate\fR, \fIWaitfor\fR,
-\fIWar\fR, \fIWhichResource\fR, \fIXmlProperty\fR, \fIXslt\fR, \fIZip\fR
+\fIAntVersion\fR, \fIApply\fR, \fIApt\fR, \fIAvailable\fR, \fIBasename\fR,
+\fIBuildNumber\fR, \fIBUnzip2\fR, \fIBZip2\fR, \fIChecksum\fR, \fIChmod\fR,
+\fIConcat\fR, \fICondition\fR, \fICopy\fR, \fIComponentdef\fR, \fICvs\fR,
+\fICvsChangeLog\fR, \fICvsVersion\fR, \fICVSPass\fR, \fICvsTagDiff\fR,
+\fIDefaultexcludes\fR, \fIDelete\fR, \fIDeltree\fR, \fIDependset\fR,
+\fIDiagnostics\fR, \fIDirname\fR, \fIEar\fR, \fIEcho\fR, \fIEchoXML\fR,
+\fIExec\fR, \fIFail\fR, \fIFilter\fR, \fIFixCRLF\fR, \fIGenKey\fR, \fIGet\fR,
+\fIHostInfo\fR, \fIGUnzip\fR, \fIGZip\fR, \fIImport\fR, \fIInclude\fR,
+\fIInput\fR, \fIJar\fR, \fIJava\fR, \fIJavac\fR, \fIJavadoc\fR, \fILength\fR,
+\fILoadFile\fR, \fILoadProperties\fR, \fILoadResource\fR, \fILocal\fR,
+\fIMakeURL\fR, \fIMail\fR, \fIMacroDef\fR, \fIManifest\fR, \fIManifestClassPath\fR,
+\fIMkdir\fR, \fIMove\fR, \fINice\fR, \fIParallel\fR, \fIPatch\fR,
+\fIPathConvert\fR, \fIPreSetDef\fR, \fIProperty\fR, \fIPropertyHelper\fR,
+\fIRecord\fR, \fIReplace\fR, \fIResourceCount\fR, \fIRetry\fR, \fIRmic\fR,
+\fISequential\fR, \fISignJar\fR, \fISleep\fR, \fISql\fR, \fISubAnt\fR,
+\fISync\fR, \fITar\fR, \fITaskdef\fR, \fITempfile\fR, \fITouch\fR,
+\fITruncate\fR, \fITStamp\fR, \fITypedef\fR, \fIUnjar\fR, \fIUntar\fR,
+\fIUnwar\fR, \fIUnzip\fR, \fIUptodate\fR, \fIWaitfor\fR, \fIWhichResource\fR,
+\fIWar\fR, \fIXmlProperty\fR, \fIXSLT\fR, \fIZip\fR
.TP
\fBJava\fR
Modified: trunk/ant/debian/changelog
===================================================================
--- trunk/ant/debian/changelog 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/changelog 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,3 +1,26 @@
+ant (1.8.0-1) unstable; urgency=low
+
+ * New upstream version
+ (Closes: #567229, #330292, #514140, #569936, #570075)
+ * Add myself to Uploaders
+ * Bump up Standards-Version to 3.8.4, no changes
+ * debian/control: update ant Depends and remove old
+ java1-runtime-headless, add new java5-runtime-headless and
+ java6-runtime-headless
+ * Demote ant-gcj from Recommends to Suggests for package ant
+ (Closes: #559058)
+ * Fix documentation for ant-optional-gcj (Closes: #563760)
+ * Update man page ant.1 and build.xml.5: fix Lintian warnings
+ and update the documentation
+ * Move the patch system to quilt, delete old patches
+ (11_ant_underscore_dash_fix.patch, 03_SplashTaskPatch_a.patch),
+ refresh all patches
+ * Add tasks for stylebook and xalan2
+ * Add debian/orig_tar.sh and use it to repack the archive without
+ compiled jars and pdf files
+
+ -- Ludovic Claude <ludovic.claude at laposte.net> Sun, 14 Feb 2010 00:03:38 +0100
+
ant (1.7.1-4) unstable; urgency=low
* Fix link to /usr/share/doc/ant-doc/manual/api. You may
Modified: trunk/ant/debian/control
===================================================================
--- trunk/ant/debian/control 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/control 2010-02-16 21:19:57 UTC (rev 11606)
@@ -3,12 +3,13 @@
Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Uploaders: Stefan Gybas <sgybas at debian.org>, Arnaud Vandyck <avdyk at debian.org>, Michael Koch <konqueror at gmx.de>,
- Matthias Klose <doko at debian.org>
-Build-Depends: cdbs (>= 0.4.8), debhelper (>= 6), default-jdk-builddep, maven-repo-helper (>= 0.7),
+ Matthias Klose <doko at debian.org>, Ludovic Claude <ludovic.claude at laposte.net>
+Build-Depends: cdbs (>= 0.4.8), debhelper (>= 6), quilt, default-jdk-builddep, maven-repo-helper (>> 1.0),
libxerces2-java, libbsf-java (>= 2.3.0rc1), liboro-java, libxalan2-java (>= 2.4.0), junit, antlr,
liblog4j1.2-java, libregexp-java, libbcel-java (>= 5.0), libcommons-logging-java, libjdepend-java,
- libgnumail-java, libxml-commons-resolver1.1-java, libcommons-net-java, libjsch-java, libjaxp1.3-java
-Standards-Version: 3.8.2
+ libgnumail-java, libxml-commons-resolver1.1-java, libcommons-net-java, libjsch-java, libjaxp1.3-java,
+ libstylebook-java
+Standards-Version: 3.8.4
Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/ant
Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/ant
Homepage: http://ant.apache.org/
@@ -16,9 +17,10 @@
Package: ant
Architecture: all
Priority: optional
-Depends: ${misc:Depends}, default-jre-headless | java1-runtime-headless | java2-runtime-headless, libxerces2-java
-Recommends: ant-optional, ant-gcj
-Suggests: default-jdk | java-compiler | java-sdk, ant-doc
+Depends: ${misc:Depends}, default-jre-headless | java2-runtime-headless | java5-runtime-headless |
+ java6-runtime-headless, libxerces2-java
+Recommends: ant-optional
+Suggests: default-jdk | java-compiler | java-sdk, ant-gcj, ant-doc
Conflicts: libant1.6-java, ant-doc (<= 1.6.5-1)
Replaces: libant1.6-java, ant-doc (<= 1.6.5-1)
Description: Java based build tool like make
@@ -33,7 +35,7 @@
Description: Java based build tool like make
A system independent (i.e. not shell based) build tool that uses XML
files as "Makefiles". This package contains the scripts and the core
- tasks libraries.
+ tasks libraries compiled natively.
Package: ant-optional
Architecture: all
@@ -52,9 +54,9 @@
Priority: optional
Depends: ant-optional, ${misc:Depends}, ${shlibs:Depends}
Description: Java based build tool like make - API documentation and manual
- A system independent (i.e. not shell based) build tool that uses XML files
- as "Makefiles". This package contains the manual of ant as well as the
- Javadoc API documentation.
+ A system independent (i.e. not shell based) build tool that uses XML
+ files as "Makefiles". This package contains the optional tasks libraries
+ compiled natively.
Package: ant-doc
Architecture: all
Added: trunk/ant/debian/orig-tar.sh
===================================================================
--- trunk/ant/debian/orig-tar.sh (rev 0)
+++ trunk/ant/debian/orig-tar.sh 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+VERSION=$2
+ORIG_TAR=$3
+TAR=../ant_$VERSION.orig.tar.gz
+DIR=apache-ant-$VERSION
+
+tar xvzf $ORIG_TAR
+tar -c -z -f $TAR --exclude '*.jar' --exclude '*.pdf' $DIR
+rm -rf $DIR
+
+# move to directory 'tarballs'
+if [ -r .svn/deb-layout ]; then
+ . .svn/deb-layout
+ mv $TAR $origDir
+ echo "moved $TAR to $origDir"
+fi
+
Property changes on: trunk/ant/debian/orig-tar.sh
___________________________________________________________________
Added: svn:executable
+ *
Deleted: trunk/ant/debian/patches/01_ant_home_path.patch
===================================================================
--- trunk/ant/debian/patches/01_ant_home_path.patch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/patches/01_ant_home_path.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,31 +0,0 @@
---- src/script/ant~ 2008-06-27 07:05:19.000000000 +0200
-+++ src/script/ant 2008-09-30 14:51:50.000000000 +0200
-@@ -90,25 +90,9 @@
- esac
-
- if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then
-- ## 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" > /dev/null && pwd`
-+ if [ -d /usr/share/ant ] ; then
-+ ANT_HOME=/usr/share/ant
-+ fi
- fi
-
- # For Cygwin, ensure paths are in UNIX format before anything is touched
Deleted: trunk/ant/debian/patches/01_gjdoc_task.patch
===================================================================
--- trunk/ant/debian/patches/01_gjdoc_task.patch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/patches/01_gjdoc_task.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,2161 +0,0 @@
-diff -uNr src.orig/main/org/apache/tools/ant/taskdefs/defaults.properties src/main/org/apache/tools/ant/taskdefs/defaults.properties
---- src/main/org/apache/tools/ant/taskdefs/defaults.properties.orig 2007-07-07 08:01:03.000000000 -0100
-+++ src/main/org/apache/tools/ant/taskdefs/defaults.properties 2007-07-07 08:01:53.000000000 -0100
-@@ -40,6 +40,7 @@
- java=org.apache.tools.ant.taskdefs.Java
- javac=org.apache.tools.ant.taskdefs.Javac
- javadoc=org.apache.tools.ant.taskdefs.Javadoc
-+gjdoc=org.apache.tools.ant.taskdefs.Gjdoc
- length=org.apache.tools.ant.taskdefs.Length
- loadfile=org.apache.tools.ant.taskdefs.LoadFile
- loadproperties=org.apache.tools.ant.taskdefs.LoadProperties
-diff -uNr src.orig/main/org/apache/tools/ant/taskdefs/Gjdoc.java src/main/org/apache/tools/ant/taskdefs/Gjdoc.java
---- src.orig/main/org/apache/tools/ant/taskdefs/Gjdoc.java 1970-01-01 01:00:00.000000000 +0100
-+++ src/main/org/apache/tools/ant/taskdefs/Gjdoc.java 2005-05-21 16:28:09.000000000 +0200
-@@ -0,0 +1,2146 @@
-+/*
-+ * Copyright 2000-2005 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.
-+ *
-+ */
-+package org.apache.tools.ant.taskdefs;
-+
-+import java.io.File;
-+import java.io.FileWriter;
-+import java.io.FilenameFilter;
-+import java.io.IOException;
-+import java.io.PrintWriter;
-+import java.io.BufferedReader;
-+import java.io.FileReader;
-+import java.net.MalformedURLException;
-+import java.net.URL;
-+import java.util.Enumeration;
-+import java.util.Locale;
-+import java.util.StringTokenizer;
-+import java.util.Vector;
-+import org.apache.tools.ant.BuildException;
-+import org.apache.tools.ant.DirectoryScanner;
-+import org.apache.tools.ant.Project;
-+import org.apache.tools.ant.ProjectComponent;
-+import org.apache.tools.ant.Task;
-+import org.apache.tools.ant.types.Commandline;
-+import org.apache.tools.ant.types.DirSet;
-+import org.apache.tools.ant.types.EnumeratedAttribute;
-+import org.apache.tools.ant.types.FileSet;
-+import org.apache.tools.ant.types.Path;
-+import org.apache.tools.ant.types.PatternSet;
-+import org.apache.tools.ant.types.Reference;
-+import org.apache.tools.ant.util.FileUtils;
-+import org.apache.tools.ant.util.JavaEnvUtils;
-+
-+/**
-+ * Generates Javadoc documentation for a collection
-+ * of source code. It used the Gjdoc tool from GNU classpath.
-+ *
-+ * <P>Current known limitations are:
-+ *
-+ * <P><UL>
-+ * <LI>patterns must be of the form "xxx.*", every other pattern doesn't
-+ * work.
-+ * <LI>there is no control on arguments sanity since they are left
-+ * to the javadoc implementation.
-+ * </UL>
-+ *
-+ * <P>If no <CODE>doclet</CODE> is set, then the <CODE>version</CODE> and
-+ * <CODE>author</CODE> are by default <CODE>"yes"</CODE>.
-+ *
-+ * <P>Note: This task is run on another VM because the Javadoc code calls
-+ * <CODE>System.exit()</CODE> which would break Ant functionality.
-+ *
-+ *
-+ * @since Ant 1.1
-+ *
-+ * @ant.task category="java"
-+ */
-+public class Gjdoc extends Task {
-+ /**
-+ * Inner class used to manage doclet parameters.
-+ */
-+ public class DocletParam {
-+ /** The parameter name */
-+ private String name;
-+
-+ /** The parameter value */
-+ private String value;
-+
-+ /**
-+ * Set the name of the parameter.
-+ *
-+ * @param name the name of the doclet parameter
-+ */
-+ public void setName(String name) {
-+ this.name = name;
-+ }
-+
-+ /**
-+ * Get the parameter name.
-+ *
-+ * @return the parameter's name.
-+ */
-+ public String getName() {
-+ return name;
-+ }
-+
-+ /**
-+ * Set the parameter value.
-+ *
-+ * Note that only string values are supported. No resolution of file
-+ * paths is performed.
-+ *
-+ * @param value the parameter value.
-+ */
-+ public void setValue(String value) {
-+ this.value = value;
-+ }
-+
-+ /**
-+ * Get the parameter value.
-+ *
-+ * @return the parameter value.
-+ */
-+ public String getValue() {
-+ return value;
-+ }
-+ }
-+
-+ /**
-+ * A project aware class used for Javadoc extensions which take a name
-+ * and a path such as doclet and taglet arguments.
-+ *
-+ */
-+ public static class ExtensionInfo extends ProjectComponent {
-+ /** The name of the extension */
-+ private String name;
-+
-+ /** The optional path to use to load the extension */
-+ private Path path;
-+
-+ /**
-+ * Set the name of the extension
-+ *
-+ * @param name the extension's name.
-+ */
-+ public void setName(String name) {
-+ this.name = name;
-+ }
-+
-+ /**
-+ * Get the name of the extension.
-+ *
-+ * @return the extension's name.
-+ */
-+ public String getName() {
-+ return name;
-+ }
-+
-+ /**
-+ * Set the path to use when loading the component.
-+ *
-+ * @param path a Path instance containing the classpath to use.
-+ */
-+ public void setPath(Path path) {
-+ if (this.path == null) {
-+ this.path = path;
-+ } else {
-+ this.path.append(path);
-+ }
-+ }
-+
-+ /**
-+ * Get the extension's path.
-+ *
-+ * @return the path to be used to load the extension.
-+ * May be <code>null</code>
-+ */
-+ public Path getPath() {
-+ return path;
-+ }
-+
-+ /**
-+ * Create an empty nested path to be configured by Ant with the
-+ * classpath for the extension.
-+ *
-+ * @return a new Path instance to be configured.
-+ */
-+ public Path createPath() {
-+ if (path == null) {
-+ path = new Path(getProject());
-+ }
-+ return path.createPath();
-+ }
-+
-+ /**
-+ * Adds a reference to a CLASSPATH defined elsewhere.
-+ *
-+ * @param r the reference containing the path.
-+ */
-+ public void setPathRef(Reference r) {
-+ createPath().setRefid(r);
-+ }
-+ }
-+
-+ /**
-+ * This class stores info about doclets.
-+ *
-+ */
-+ public class DocletInfo extends ExtensionInfo {
-+
-+ /** Collection of doclet parameters. */
-+ private Vector params = new Vector();
-+
-+ /**
-+ * Create a doclet parameter to be configured by Ant.
-+ *
-+ * @return a new DocletParam instance to be configured.
-+ */
-+ public DocletParam createParam() {
-+ DocletParam param = new DocletParam();
-+ params.addElement(param);
-+
-+ return param;
-+ }
-+
-+ /**
-+ * Get the doclet's parameters.
-+ *
-+ * @return an Enumeration of DocletParam instances.
-+ */
-+ public Enumeration getParams() {
-+ return params.elements();
-+ }
-+ }
-+
-+ /**
-+ * Used to track info about the packages to be javadoc'd
-+ */
-+ public static class PackageName {
-+ /** The package name */
-+ private String name;
-+
-+ /**
-+ * Set the name of the package
-+ *
-+ * @param name the package name.
-+ */
-+ public void setName(String name) {
-+ this.name = name.trim();
-+ }
-+
-+ /**
-+ * Get the package name.
-+ *
-+ * @return the package's name.
-+ */
-+ public String getName() {
-+ return name;
-+ }
-+
-+ /**
-+ * @see java.lang.Object#toString
-+ */
-+ public String toString() {
-+ return getName();
-+ }
-+ }
-+
-+ /**
-+ * This class is used to manage the source files to be processed.
-+ */
-+ public static class SourceFile {
-+ /** The source file */
-+ private File file;
-+
-+ /**
-+ * Default constructor
-+ */
-+ public SourceFile() {
-+ }
-+
-+ /**
-+ * Constructor specifying the source file directly
-+ *
-+ * @param file the source file
-+ */
-+ public SourceFile(File file) {
-+ this.file = file;
-+ }
-+
-+ /**
-+ * Set the source file.
-+ *
-+ * @param file the source file.
-+ */
-+ public void setFile(File file) {
-+ this.file = file;
-+ }
-+
-+ /**
-+ * Get the source file.
-+ *
-+ * @return the source file.
-+ */
-+ public File getFile() {
-+ return file;
-+ }
-+ }
-+
-+ /**
-+ * An HTML element in the javadoc.
-+ *
-+ * This class is used for those javadoc elements which contain HTML such as
-+ * footers, headers, etc.
-+ */
-+ public static class Html {
-+ /** The text for the element */
-+ private StringBuffer text = new StringBuffer();
-+
-+ /**
-+ * Add text to the element.
-+ *
-+ * @param t the text to be added.
-+ */
-+ public void addText(String t) {
-+ text.append(t);
-+ }
-+
-+ /**
-+ * Get the current text for the element.
-+ *
-+ * @return the current text.
-+ */
-+ public String getText() {
-+ return text.substring(0);
-+ }
-+ }
-+
-+ /**
-+ * EnumeratedAttribute implementation supporting the javadoc scoping
-+ * values.
-+ */
-+ public static class AccessType extends EnumeratedAttribute {
-+ /**
-+ * @see EnumeratedAttribute#getValues().
-+ */
-+ public String[] getValues() {
-+ // Protected first so if any GUI tool offers a default
-+ // based on enum #0, it will be right.
-+ return new String[] {"protected", "public", "package", "private"};
-+ }
-+ }
-+
-+ /** The command line built to execute Javadoc. */
-+ private Commandline cmd = new Commandline();
-+
-+ /**
-+ * Utility method to add an argument to the command line conditionally
-+ * based on the given flag.
-+ *
-+ * @param b the flag which controls if the argument is added.
-+ * @param arg the argument value.
-+ */
-+ private void addArgIf(boolean b, String arg) {
-+ if (b) {
-+ cmd.createArgument().setValue(arg);
-+ }
-+ }
-+
-+ /**
-+ * Utility method to add a javadoc argument.
-+ *
-+ * @param key the argument name.
-+ * @param value the argument value.
-+ */
-+ private void addArgIfNotEmpty(String key, String value) {
-+ if (value != null && value.length() != 0) {
-+ cmd.createArgument().setValue(key);
-+ cmd.createArgument().setValue(value);
-+ } else {
-+ log("Warning: Leaving out empty argument '" + key + "'",
-+ Project.MSG_WARN);
-+ }
-+ }
-+
-+ /**
-+ * Flag which indicates if the task should fail if there is a
-+ * javadoc error.
-+ */
-+ private boolean failOnError = false;
-+ private Path sourcePath = null;
-+ private File destDir = null;
-+ private Vector sourceFiles = new Vector();
-+ private Vector packageNames = new Vector();
-+ private Vector excludePackageNames = new Vector(1);
-+ private boolean author = true;
-+ private boolean version = true;
-+ private DocletInfo doclet = null;
-+ private Path classpath = null;
-+ private Path bootclasspath = null;
-+ private String group = null;
-+ private String packageList = null;
-+ private Vector links = new Vector();
-+ private Vector groups = new Vector();
-+ private Vector tags = new Vector();
-+ private boolean useDefaultExcludes = true;
-+ private Html doctitle = null;
-+ private Html header = null;
-+ private Html footer = null;
-+ private Html bottom = null;
-+ private boolean useExternalFile = false;
-+ private FileUtils fileUtils = FileUtils.newFileUtils();
-+ private String source = null;
-+ private boolean linksource = false;
-+ private boolean breakiterator = false;
-+ private String noqualifier;
-+ private boolean includeNoSourcePackages = false;
-+ private boolean old = false;
-+ private String executable = null;
-+
-+ private Vector fileSets = new Vector();
-+ private Vector packageSets = new Vector();
-+
-+ /**
-+ * Work around command line length limit by using an external file
-+ * for the sourcefiles.
-+ *
-+ * @param b true if an external file is to be used.
-+ */
-+ public void setUseExternalFile(boolean b) {
-+ useExternalFile = b;
-+ }
-+
-+ /**
-+ * Sets whether default exclusions should be used or not.
-+ *
-+ * @param useDefaultExcludes "true"|"on"|"yes" when default exclusions
-+ * should be used, "false"|"off"|"no" when they
-+ * shouldn't be used.
-+ */
-+ public void setDefaultexcludes(boolean useDefaultExcludes) {
-+ this.useDefaultExcludes = useDefaultExcludes;
-+ }
-+
-+ /**
-+ * Set the maximum memory to be used by the javadoc process
-+ *
-+ * @param max a string indicating the maximum memory according to the
-+ * JVM conventions (e.g. 128m is 128 Megabytes)
-+ */
-+ public void setMaxmemory(String max) {
-+ cmd.createArgument().setValue("-J-Xmx" + max);
-+ }
-+
-+ /**
-+ * Set an additional parameter on the command line
-+ *
-+ * @param add the additional command line parameter for the javadoc task.
-+ */
-+ public void setAdditionalparam(String add) {
-+ cmd.createArgument().setLine(add);
-+ }
-+
-+ /**
-+ * Adds a command-line argument.
-+ * @since Ant 1.6
-+ */
-+ public Commandline.Argument createArg() {
-+ return cmd.createArgument();
-+ }
-+
-+ /**
-+ * Specify where to find source file
-+ *
-+ * @param src a Path instance containing the various source directories.
-+ */
-+ public void setSourcepath(Path src) {
-+ if (sourcePath == null) {
-+ sourcePath = src;
-+ } else {
-+ sourcePath.append(src);
-+ }
-+ }
-+
-+ /**
-+ * Create a path to be configured with the locations of the source
-+ * files.
-+ *
-+ * @return a new Path instance to be configured by the Ant core.
-+ */
-+ public Path createSourcepath() {
-+ if (sourcePath == null) {
-+ sourcePath = new Path(getProject());
-+ }
-+ return sourcePath.createPath();
-+ }
-+
-+ /**
-+ * Adds a reference to a CLASSPATH defined elsewhere.
-+ *
-+ * @param r the reference containing the source path definition.
-+ */
-+ public void setSourcepathRef(Reference r) {
-+ createSourcepath().setRefid(r);
-+ }
-+
-+ /**
-+ * Set the directory where the Javadoc output will be generated.
-+ *
-+ * @param dir the destination directory.
-+ */
-+ public void setDestdir(File dir) {
-+ destDir = dir;
-+ cmd.createArgument().setValue("-d");
-+ cmd.createArgument().setFile(destDir);
-+ }
-+
-+ /**
-+ * Set the list of source files to process.
-+ *
-+ * @param src a comma separated list of source files.
-+ */
-+ public void setSourcefiles(String src) {
-+ StringTokenizer tok = new StringTokenizer(src, ",");
-+ while (tok.hasMoreTokens()) {
-+ String f = tok.nextToken();
-+ SourceFile sf = new SourceFile();
-+ sf.setFile(getProject().resolveFile(f.trim()));
-+ addSource(sf);
-+ }
-+ }
-+
-+ /**
-+ * Add a single source file.
-+ *
-+ * @param sf the source file to be processed.
-+ */
-+ public void addSource(SourceFile sf) {
-+ sourceFiles.addElement(sf);
-+ }
-+
-+ /**
-+ * Set the package names to be processed.
-+ *
-+ * @param packages a comma separated list of packages specs
-+ * (may be wildcarded).
-+ *
-+ * @see #addPackage for wildcard information.
-+ */
-+ public void setPackagenames(String packages) {
-+ StringTokenizer tok = new StringTokenizer(packages, ",");
-+ while (tok.hasMoreTokens()) {
-+ String p = tok.nextToken();
-+ PackageName pn = new PackageName();
-+ pn.setName(p);
-+ addPackage(pn);
-+ }
-+ }
-+
-+ /**
-+ * Add a single package to be processed.
-+ *
-+ * If the package name ends with ".*" the Javadoc task
-+ * will find and process all subpackages.
-+ *
-+ * @param pn the package name, possibly wildcarded.
-+ */
-+ public void addPackage(PackageName pn) {
-+ packageNames.addElement(pn);
-+ }
-+
-+ /**
-+ * Set the list of packages to be excluded.
-+ *
-+ * @param packages a comma separated list of packages to be excluded.
-+ * This may not include wildcards.
-+ */
-+ public void setExcludePackageNames(String packages) {
-+ StringTokenizer tok = new StringTokenizer(packages, ",");
-+ while (tok.hasMoreTokens()) {
-+ String p = tok.nextToken();
-+ PackageName pn = new PackageName();
-+ pn.setName(p);
-+ addExcludePackage(pn);
-+ }
-+ }
-+
-+ /**
-+ * Add a package to be excluded from the javadoc run.
-+ *
-+ * @param pn the name of the package (wildcards are not permitted).
-+ */
-+ public void addExcludePackage(PackageName pn) {
-+ excludePackageNames.addElement(pn);
-+ }
-+
-+ /**
-+ * Specify the file containing the overview to be included in the generated
-+ * documentation.
-+ *
-+ * @param f the file containing the overview.
-+ */
-+ public void setOverview(File f) {
-+ cmd.createArgument().setValue("-overview");
-+ cmd.createArgument().setFile(f);
-+ }
-+
-+ /**
-+ * Indicate whether only public classes and members are to be included in
-+ * the scope processed
-+ *
-+ * @param b true if scope is to be public.
-+ */
-+ public void setPublic(boolean b) {
-+ addArgIf(b, "-public");
-+ }
-+
-+ /**
-+ * Indicate whether only protected and public classes and members are to
-+ * be included in the scope processed
-+ *
-+ * @param b true if scope is to be protected.
-+ */
-+ public void setProtected(boolean b) {
-+ addArgIf(b, "-protected");
-+ }
-+
-+ /**
-+ * Indicate whether only package, protected and public classes and
-+ * members are to be included in the scope processed
-+ *
-+ * @param b true if scope is to be package level.
-+ */
-+ public void setPackage(boolean b) {
-+ addArgIf(b, "-package");
-+ }
-+
-+ /**
-+ * Indicate whether all classes and
-+ * members are to be included in the scope processed
-+ *
-+ * @param b true if scope is to be private level.
-+ */
-+ public void setPrivate(boolean b) {
-+ addArgIf(b, "-private");
-+ }
-+
-+ /**
-+ * Set the scope to be processed. This is an alternative to the
-+ * use of the setPublic, setPrivate, etc methods. It gives better build
-+ * file control over what scope is processed.
-+ *
-+ * @param at the scope to be processed.
-+ */
-+ public void setAccess(AccessType at) {
-+ cmd.createArgument().setValue("-" + at.getValue());
-+ }
-+
-+ /**
-+ * Set the class that starts the doclet used in generating the
-+ * documentation.
-+ *
-+ * @param docletName the name of the doclet class.
-+ */
-+ public void setDoclet(String docletName) {
-+ if (doclet == null) {
-+ doclet = new DocletInfo();
-+ doclet.setProject(getProject());
-+ }
-+ doclet.setName(docletName);
-+ }
-+
-+ /**
-+ * Set the classpath used to find the doclet class.
-+ *
-+ * @param docletPath the doclet classpath.
-+ */
-+ public void setDocletPath(Path docletPath) {
-+ if (doclet == null) {
-+ doclet = new DocletInfo();
-+ doclet.setProject(getProject());
-+ }
-+ doclet.setPath(docletPath);
-+ }
-+
-+ /**
-+ * Set the classpath used to find the doclet class by reference.
-+ *
-+ * @param r the reference to the Path instance to use as the doclet
-+ * classpath.
-+ */
-+ public void setDocletPathRef(Reference r) {
-+ if (doclet == null) {
-+ doclet = new DocletInfo();
-+ doclet.setProject(getProject());
-+ }
-+ doclet.createPath().setRefid(r);
-+ }
-+
-+ /**
-+ * Create a doclet to be used in the documentation generation.
-+ *
-+ * @return a new DocletInfo instance to be configured.
-+ */
-+ public DocletInfo createDoclet() {
-+ doclet = new DocletInfo();
-+ return doclet;
-+ }
-+
-+ /**
-+ * Add a taglet
-+ *
-+ * @param tagletInfo information about the taglet.
-+ */
-+ public void addTaglet(ExtensionInfo tagletInfo) {
-+ tags.addElement(tagletInfo);
-+ }
-+
-+ /**
-+ * Indicate whether Javadoc should produce old style (JDK 1.1)
-+ * documentation.
-+ *
-+ * This is not supported by JDK 1.1 and has been phased out in JDK 1.4
-+ *
-+ * @param b if true attempt to generate old style documentation.
-+ */
-+ public void setOld(boolean b) {
-+ old = b;
-+ }
-+
-+ /**
-+ * Set the classpath to be used for this javadoc run.
-+ *
-+ * @param path an Ant Path object containing the compilation
-+ * classpath.
-+ */
-+ public void setClasspath(Path path) {
-+ if (classpath == null) {
-+ classpath = path;
-+ } else {
-+ classpath.append(path);
-+ }
-+ }
-+
-+ /**
-+ * Create a Path to be configured with the classpath to use
-+ *
-+ * @return a new Path instance to be configured with the classpath.
-+ */
-+ public Path createClasspath() {
-+ if (classpath == null) {
-+ classpath = new Path(getProject());
-+ }
-+ return classpath.createPath();
-+ }
-+
-+ /**
-+ * Adds a reference to a CLASSPATH defined elsewhere.
-+ *
-+ * @param r the reference to an instance defining the classpath.
-+ */
-+ public void setClasspathRef(Reference r) {
-+ createClasspath().setRefid(r);
-+ }
-+
-+ /**
-+ * Set the boot classpath to use.
-+ *
-+ * @param path the boot classpath.
-+ */
-+ public void setBootclasspath(Path path) {
-+ if (bootclasspath == null) {
-+ bootclasspath = path;
-+ } else {
-+ bootclasspath.append(path);
-+ }
-+ }
-+
-+ /**
-+ * Create a Path to be configured with the boot classpath
-+ *
-+ * @return a new Path instance to be configured with the boot classpath.
-+ */
-+ public Path createBootclasspath() {
-+ if (bootclasspath == null) {
-+ bootclasspath = new Path(getProject());
-+ }
-+ return bootclasspath.createPath();
-+ }
-+
-+ /**
-+ * Adds a reference to a CLASSPATH defined elsewhere.
-+ *
-+ * @param r the reference to an instance defining the bootclasspath.
-+ */
-+ public void setBootClasspathRef(Reference r) {
-+ createBootclasspath().setRefid(r);
-+ }
-+
-+ /**
-+ * Set the location of the extensions directories.
-+ *
-+ * @param path the string version of the path.
-+ * @deprecated Use the {@link #setExtdirs(Path)} version.
-+ */
-+ public void setExtdirs(String path) {
-+ cmd.createArgument().setValue("-extdirs");
-+ cmd.createArgument().setValue(path);
-+ }
-+
-+ /**
-+ * Set the location of the extensions directories.
-+ *
-+ * @param path a path containing the extension directories.
-+ */
-+ public void setExtdirs(Path path) {
-+ cmd.createArgument().setValue("-extdirs");
-+ cmd.createArgument().setPath(path);
-+ }
-+
-+ /**
-+ * Run javadoc in verbose mode
-+ *
-+ * @param b true if operation is to be verbose.
-+ */
-+ public void setVerbose(boolean b) {
-+ addArgIf(b, "-verbose");
-+ }
-+
-+ /**
-+ * Set the local to use in documentation generation.
-+ *
-+ * @param locale the locale to use.
-+ */
-+ public void setLocale(String locale) {
-+ // createArgument(true) is necessary to make sure, -locale
-+ // is the first argument (required in 1.3+).
-+ cmd.createArgument(true).setValue(locale);
-+ cmd.createArgument(true).setValue("-locale");
-+ }
-+
-+ /**
-+ * Set the encoding name of the source files,
-+ *
-+ * @param enc the name of the encoding for the source files.
-+ */
-+ public void setEncoding(String enc) {
-+ cmd.createArgument().setValue("-encoding");
-+ cmd.createArgument().setValue(enc);
-+ }
-+
-+ /**
-+ * Include the version tag in the generated documentation.
-+ *
-+ * @param b true if the version tag should be included.
-+ */
-+ public void setVersion(boolean b) {
-+ this.version = b;
-+ }
-+
-+ /**
-+ * Generate the "use" page for each package.
-+ *
-+ * @param b true if the use page should be generated.
-+ */
-+ public void setUse(boolean b) {
-+ addArgIf(b, "-use");
-+ }
-+
-+
-+ /**
-+ * Include the author tag in the generated documentation.
-+ *
-+ * @param b true if the author tag should be included.
-+ */
-+ public void setAuthor(boolean b) {
-+ author = b;
-+ }
-+
-+ /**
-+ * Generate a split index
-+ *
-+ * @param b true if the index should be split into a file per letter.
-+ */
-+ public void setSplitindex(boolean b) {
-+ addArgIf(b, "-splitindex");
-+ }
-+
-+ /**
-+ * Set the title to be placed in the HTML <title> tag of the
-+ * generated documentation.
-+ *
-+ * @param title the window title to use.
-+ */
-+ public void setWindowtitle(String title) {
-+ addArgIfNotEmpty("-windowtitle", title);
-+ }
-+
-+ /**
-+ * Set the title of the generated overview page.
-+ *
-+ * @param doctitle the Document title.
-+ */
-+ public void setDoctitle(String doctitle) {
-+ Html h = new Html();
-+ h.addText(doctitle);
-+ addDoctitle(h);
-+ }
-+
-+ /**
-+ * Add a document title to use for the overview page.
-+ *
-+ * @param text the HTML element containing the document title.
-+ */
-+ public void addDoctitle(Html text) {
-+ doctitle = text;
-+ }
-+
-+ /**
-+ * Set the header text to be placed at the top of each output file.
-+ *
-+ * @param header the header text
-+ */
-+ public void setHeader(String header) {
-+ Html h = new Html();
-+ h.addText(header);
-+ addHeader(h);
-+ }
-+
-+ /**
-+ * Set the header text to be placed at the top of each output file.
-+ *
-+ * @param text the header text
-+ */
-+ public void addHeader(Html text) {
-+ header = text;
-+ }
-+
-+ /**
-+ * Set the footer text to be placed at the bottom of each output file.
-+ *
-+ * @param footer the footer text.
-+ */
-+ public void setFooter(String footer) {
-+ Html h = new Html();
-+ h.addText(footer);
-+ addFooter(h);
-+ }
-+
-+ /**
-+ * Set the footer text to be placed at the bottom of each output file.
-+ *
-+ * @param text the footer text.
-+ */
-+ public void addFooter(Html text) {
-+ footer = text;
-+ }
-+
-+ /**
-+ * Set the text to be placed at the bottom of each output file.
-+ *
-+ * @param bottom the bottom text.
-+ */
-+ public void setBottom(String bottom) {
-+ Html h = new Html();
-+ h.addText(bottom);
-+ addBottom(h);
-+ }
-+
-+ /**
-+ * Set the text to be placed at the bottom of each output file.
-+ *
-+ * @param text the bottom text.
-+ */
-+ public void addBottom(Html text) {
-+ bottom = text;
-+ }
-+
-+ /**
-+ * Link to docs at "url" using package list at "url2"
-+ * - separate the URLs by using a space character.
-+ *
-+ * @param src the offline link specification (url and package list)
-+ */
-+ public void setLinkoffline(String src) {
-+ if (/*1.2+*/true) {
-+ LinkArgument le = createLink();
-+ le.setOffline(true);
-+ String linkOfflineError = "The linkoffline attribute must include"
-+ + " a URL and a package-list file location separated by a"
-+ + " space";
-+ if (src.trim().length() == 0) {
-+ throw new BuildException(linkOfflineError);
-+ }
-+ StringTokenizer tok = new StringTokenizer(src, " ", false);
-+ le.setHref(tok.nextToken());
-+
-+ if (!tok.hasMoreTokens()) {
-+ throw new BuildException(linkOfflineError);
-+ }
-+ le.setPackagelistLoc(getProject().resolveFile(tok.nextToken()));
-+ }
-+ }
-+
-+ /**
-+ * Group specified packages together in overview page.
-+ *
-+ * @param src the group packages - a command separated list of group specs,
-+ * each one being a group name and package specification separated
-+ * by a space.
-+ */
-+ public void setGroup(String src) {
-+ group = src;
-+ }
-+
-+ /**
-+ * Create links to javadoc output at the given URL.
-+ */
-+ public void setLink(String src) {
-+ createLink().setHref(src);
-+ }
-+
-+ /**
-+ * Control deprecation infromation
-+ *
-+ * @param b If true, do not include deprecated information.
-+ */
-+ public void setNodeprecated(boolean b) {
-+ addArgIf(b, "-nodeprecated");
-+ }
-+
-+ /**
-+ * Control deprecated list generation
-+ *
-+ * @param b if true, do not generate deprecated list.
-+ */
-+ public void setNodeprecatedlist(boolean b) {
-+ addArgIf(b, "-nodeprecatedlist");
-+ }
-+
-+ /**
-+ * Control class tree generation.
-+ *
-+ * @param b if true, do not generate class hierarchy.
-+ */
-+ public void setNotree(boolean b) {
-+ addArgIf(b, "-notree");
-+ }
-+
-+ /**
-+ * Control generation of index.
-+ *
-+ * @param b if true, do not generate index.
-+ */
-+ public void setNoindex(boolean b) {
-+ addArgIf(b, "-noindex");
-+ }
-+
-+ /**
-+ * Control generation of help link.
-+ *
-+ * @param b if true, do not generate help link
-+ */
-+ public void setNohelp(boolean b) {
-+ addArgIf(b, "-nohelp");
-+ }
-+
-+ /**
-+ * Control generation of the navigation bar.
-+ *
-+ * @param b if true, do not generate navigation bar.
-+ */
-+ public void setNonavbar(boolean b) {
-+ addArgIf(b, "-nonavbar");
-+ }
-+
-+ /**
-+ * Control warnings about serial tag.
-+ *
-+ * @param b if true, generate warning about the serial tag.
-+ */
-+ public void setSerialwarn(boolean b) {
-+ addArgIf(b, "-serialwarn");
-+ }
-+
-+ /**
-+ * Specifies the CSS stylesheet file to use.
-+ *
-+ * @param f the file with the CSS to use.
-+ */
-+ public void setStylesheetfile(File f) {
-+ cmd.createArgument().setValue("-stylesheetfile");
-+ cmd.createArgument().setFile(f);
-+ }
-+
-+ /**
-+ * Specifies the HTML help file to use.
-+ *
-+ * @param f the file containing help content.
-+ */
-+ public void setHelpfile(File f) {
-+ cmd.createArgument().setValue("-helpfile");
-+ cmd.createArgument().setFile(f);
-+ }
-+
-+ /**
-+ * Output file encoding name.
-+ *
-+ * @param enc name of the encoding to use.
-+ */
-+ public void setDocencoding(String enc) {
-+ cmd.createArgument().setValue("-docencoding");
-+ cmd.createArgument().setValue(enc);
-+ }
-+
-+ /**
-+ * The name of a file containing the packages to process.
-+ *
-+ * @param src the file containing the package list.
-+ */
-+ public void setPackageList(String src) {
-+ packageList = src;
-+ }
-+
-+ /**
-+ * Create link to javadoc output at the given URL.
-+ *
-+ * @return link argument to configure
-+ */
-+ public LinkArgument createLink() {
-+ LinkArgument la = new LinkArgument();
-+ links.addElement(la);
-+ return la;
-+ }
-+
-+ /**
-+ * Represents a link triplet (href, whether link is offline, location of the
-+ * package list if off line)
-+ */
-+ public class LinkArgument {
-+ private String href;
-+ private boolean offline = false;
-+ private File packagelistLoc;
-+ private boolean resolveLink = false;
-+
-+ public LinkArgument() {
-+ }
-+
-+ public void setHref(String hr) {
-+ href = hr;
-+ }
-+
-+ public String getHref() {
-+ return href;
-+ }
-+
-+ public void setPackagelistLoc(File src) {
-+ packagelistLoc = src;
-+ }
-+
-+ public File getPackagelistLoc() {
-+ return packagelistLoc;
-+ }
-+
-+ public void setOffline(boolean offline) {
-+ this.offline = offline;
-+ }
-+
-+ public boolean isLinkOffline() {
-+ return offline;
-+ }
-+
-+ /**
-+ * Sets whether Ant should resolve the link attribute relative
-+ * to the current basedir.
-+ * @param resolve a <code>boolean</code> value
-+ */
-+ public void setResolveLink(boolean resolve) {
-+ this.resolveLink = resolve;
-+ }
-+
-+ /**
-+ * should Ant resolve the link attribute relative to the
-+ * current basedir?
-+ */
-+ public boolean shouldResolveLink() {
-+ return resolveLink;
-+ }
-+
-+ }
-+
-+ /**
-+ * Creates and adds a -tag argument. This is used to specify
-+ * custom tags. This argument is only available for JavaDoc 1.4,
-+ * and will generate a verbose message (and then be ignored)
-+ * when run on Java versions below 1.4.
-+ */
-+ public TagArgument createTag() {
-+ TagArgument ta = new TagArgument();
-+ tags.addElement (ta);
-+ return ta;
-+ }
-+
-+ /**
-+ * Scope element verbose names. (Defined here as fields
-+ * cannot be static in inner classes.) The first letter
-+ * from each element is used to build up the scope string.
-+ */
-+ static final String[] SCOPE_ELEMENTS = {
-+ "overview", "packages", "types", "constructors",
-+ "methods", "fields"
-+ };
-+
-+ /**
-+ * Class representing a -tag argument.
-+ */
-+ public class TagArgument extends FileSet {
-+ /** Name of the tag. */
-+ private String name = null;
-+ /** Description of the tag to place in the JavaDocs. */
-+ private String description = null;
-+ /** Whether or not the tag is enabled. */
-+ private boolean enabled = true;
-+ /**
-+ * Scope string of the tag. This will form the middle
-+ * argument of the -tag parameter when the tag is enabled
-+ * (with an X prepended for and is parsed from human-readable form.
-+ */
-+ private String scope = "a";
-+
-+ /** Sole constructor. */
-+ public TagArgument () {
-+ }
-+
-+ /**
-+ * Sets the name of the tag.
-+ *
-+ * @param name The name of the tag.
-+ * Must not be <code>null</code> or empty.
-+ */
-+ public void setName (String name) {
-+ this.name = name;
-+ }
-+
-+ /**
-+ * Sets the description of the tag. This is what appears in
-+ * the JavaDoc.
-+ *
-+ * @param description The description of the tag.
-+ * Must not be <code>null</code> or empty.
-+ */
-+ public void setDescription (String description) {
-+ this.description = description;
-+ }
-+
-+ /**
-+ * Sets the scope of the tag. This is in comma-separated
-+ * form, with each element being one of "all" (the default),
-+ * "overview", "packages", "types", "constructors", "methods",
-+ * "fields". The elements are treated in a case-insensitive
-+ * manner.
-+ *
-+ * @param verboseScope The scope of the tag.
-+ * Must not be <code>null</code>,
-+ * should not be empty.
-+ *
-+ * @exception BuildException if all is specified along with
-+ * other elements, if any elements are repeated, if no
-+ * elements are specified, or if any unrecognised elements are
-+ * specified.
-+ */
-+ public void setScope (String verboseScope) throws BuildException {
-+ verboseScope = verboseScope.toLowerCase(Locale.US);
-+
-+ boolean[] elements = new boolean[SCOPE_ELEMENTS.length];
-+
-+ boolean gotAll = false;
-+ boolean gotNotAll = false;
-+
-+ // Go through the tokens one at a time, updating the
-+ // elements array and issuing warnings where appropriate.
-+ StringTokenizer tok = new StringTokenizer (verboseScope, ",");
-+ while (tok.hasMoreTokens()) {
-+ String next = tok.nextToken().trim();
-+ if (next.equals("all")) {
-+ if (gotAll) {
-+ getProject().log ("Repeated tag scope element: all",
-+ Project.MSG_VERBOSE);
-+ }
-+ gotAll = true;
-+ } else {
-+ int i;
-+ for (i = 0; i < SCOPE_ELEMENTS.length; i++) {
-+ if (next.equals (SCOPE_ELEMENTS[i])) {
-+ break;
-+ }
-+ }
-+ if (i == SCOPE_ELEMENTS.length) {
-+ throw new BuildException ("Unrecognised scope element: "
-+ + next);
-+ } else {
-+ if (elements[i]) {
-+ getProject().log ("Repeated tag scope element: "
-+ + next, Project.MSG_VERBOSE);
-+ }
-+ elements[i] = true;
-+ gotNotAll = true;
-+ }
-+ }
-+ }
-+
-+ if (gotNotAll && gotAll) {
-+ throw new BuildException ("Mixture of \"all\" and other scope "
-+ + "elements in tag parameter.");
-+ }
-+ if (!gotNotAll && !gotAll) {
-+ throw new BuildException ("No scope elements specified in tag "
-+ + "parameter.");
-+ }
-+ if (gotAll) {
-+ this.scope = "a";
-+ } else {
-+ StringBuffer buff = new StringBuffer (elements.length);
-+ for (int i = 0; i < elements.length; i++) {
-+ if (elements[i]) {
-+ buff.append (SCOPE_ELEMENTS[i].charAt(0));
-+ }
-+ }
-+ this.scope = buff.toString();
-+ }
-+ }
-+
-+ /**
-+ * Sets whether or not the tag is enabled.
-+ *
-+ * @param enabled Whether or not this tag is enabled.
-+ */
-+ public void setEnabled (boolean enabled) {
-+ this.enabled = enabled;
-+ }
-+
-+ /**
-+ * Returns the -tag parameter this argument represented.
-+ *
-+ * @exception BuildException if either the name or description
-+ * is <code>null</code> or empty.
-+ */
-+ public String getParameter () throws BuildException {
-+ if (name == null || name.equals("")) {
-+ throw new BuildException ("No name specified for custom tag.");
-+ }
-+ if (description != null) {
-+ return name + ":" + (enabled ? "" : "X")
-+ + scope + ":" + description;
-+ } else {
-+ return name;
-+ }
-+ }
-+ }
-+
-+ /**
-+ * Separates packages on the overview page into whatever
-+ * groups you specify, one group per table.
-+ */
-+ public GroupArgument createGroup() {
-+ GroupArgument ga = new GroupArgument();
-+ groups.addElement(ga);
-+ return ga;
-+ }
-+
-+ public class GroupArgument {
-+ private Html title;
-+ private Vector packages = new Vector();
-+
-+ public GroupArgument() {
-+ }
-+
-+ public void setTitle(String src) {
-+ Html h = new Html();
-+ h.addText(src);
-+ addTitle(h);
-+ }
-+ public void addTitle(Html text) {
-+ title = text;
-+ }
-+
-+ public String getTitle() {
-+ return title != null ? title.getText() : null;
-+ }
-+
-+ public void setPackages(String src) {
-+ StringTokenizer tok = new StringTokenizer(src, ",");
-+ while (tok.hasMoreTokens()) {
-+ String p = tok.nextToken();
-+ PackageName pn = new PackageName();
-+ pn.setName(p);
-+ addPackage(pn);
-+ }
-+ }
-+ public void addPackage(PackageName pn) {
-+ packages.addElement(pn);
-+ }
-+
-+ public String getPackages() {
-+ StringBuffer p = new StringBuffer();
-+ for (int i = 0; i < packages.size(); i++) {
-+ if (i > 0) {
-+ p.append(":");
-+ }
-+ p.append(packages.elementAt(i).toString());
-+ }
-+ return p.toString();
-+ }
-+ }
-+
-+ /**
-+ * Charset for cross-platform viewing of generated documentation.
-+ */
-+ public void setCharset(String src) {
-+ this.addArgIfNotEmpty("-charset", src);
-+ }
-+
-+ /**
-+ * Should the build process fail if javadoc fails (as indicated by
-+ * a non zero return code)?
-+ *
-+ * <p>Default is false.</p>
-+ */
-+ public void setFailonerror(boolean b) {
-+ failOnError = b;
-+ }
-+
-+ /**
-+ * Enables the -source switch, will be ignored if javadoc is not
-+ * the 1.4 version.
-+ *
-+ * @since Ant 1.5
-+ */
-+ public void setSource(String source) {
-+ this.source = source;
-+ }
-+
-+ /**
-+ * Sets the actual executable command to invoke, instead of the binary
-+ * <code>javadoc</code> found in Ant's JDK.
-+ * @since Ant 1.6.3
-+ */
-+ public void setExecutable(String executable) {
-+ this.executable = executable;
-+ }
-+
-+ /**
-+ * Adds a packageset.
-+ *
-+ * <p>All included directories will be translated into package
-+ * names be converting the directory separator into dots.</p>
-+ *
-+ * @since 1.5
-+ */
-+ public void addPackageset(DirSet packageSet) {
-+ packageSets.addElement(packageSet);
-+ }
-+
-+ /**
-+ * Adds a fileset.
-+ *
-+ * <p>All included files will be added as sourcefiles. The task
-+ * will automatically add
-+ * <code>includes="**/*.java"</code> to the
-+ * fileset.</p>
-+ *
-+ * @since 1.5
-+ */
-+ public void addFileset(FileSet fs) {
-+ fileSets.addElement(fs);
-+ }
-+
-+ /**
-+ * Enables the -linksource switch, will be ignored if javadoc is not
-+ * the 1.4 version. Default is false
-+ *
-+ * @since Ant 1.6
-+ */
-+ public void setLinksource(boolean b) {
-+ this.linksource = b;
-+ }
-+
-+ /**
-+ * Enables the -linksource switch, will be ignored if javadoc is not
-+ * the 1.4 version. Default is false
-+ *
-+ * @since Ant 1.6
-+ */
-+ public void setBreakiterator(boolean b) {
-+ this.breakiterator = b;
-+ }
-+
-+ /**
-+ * Enables the -noqualifier switch, will be ignored if javadoc is not
-+ * the 1.4 version.
-+ *
-+ * @since Ant 1.6
-+ */
-+ public void setNoqualifier(String noqualifier) {
-+ this.noqualifier = noqualifier;
-+ }
-+
-+ /**
-+ * If set to true, Ant will also accept packages that only hold
-+ * package.html files but no Java sources.
-+ * @since Ant 1.6.3
-+ */
-+ public void setIncludeNoSourcePackages(boolean b) {
-+ this.includeNoSourcePackages = b;
-+ }
-+
-+ public void execute() throws BuildException {
-+
-+ // Whether *this VM* is 1.4+ (but also check executable != null).
-+ boolean javadoc4 =
-+ !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) &&
-+ !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3);
-+
-+ Vector packagesToDoc = new Vector();
-+ Path sourceDirs = new Path(getProject());
-+
-+ if (packageList != null && sourcePath == null) {
-+ String msg = "sourcePath attribute must be set when "
-+ + "specifying packagelist.";
-+ throw new BuildException(msg);
-+ }
-+
-+ if (sourcePath != null) {
-+ sourceDirs.addExisting(sourcePath);
-+ }
-+
-+ parsePackages(packagesToDoc, sourceDirs);
-+
-+ if (packagesToDoc.size() != 0 && sourceDirs.size() == 0) {
-+ String msg = "sourcePath attribute must be set when "
-+ + "specifying package names.";
-+ throw new BuildException(msg);
-+ }
-+
-+ Vector sourceFilesToDoc = (Vector) sourceFiles.clone();
-+ addFileSets(sourceFilesToDoc);
-+
-+ if (packageList == null && packagesToDoc.size() == 0
-+ && sourceFilesToDoc.size() == 0) {
-+ throw new BuildException("No source files and no packages have "
-+ + "been specified.");
-+ }
-+
-+ log("Generating Javadoc with Gjdoc", Project.MSG_INFO);
-+
-+ Commandline toExecute = (Commandline) cmd.clone();
-+
-+ if (executable != null)
-+ toExecute.setExecutable(executable);
-+ else
-+ toExecute.setExecutable("/usr/bin/gjdoc");
-+
-+
-+ // ------------------------------------------ general javadoc arguments
-+ if (doctitle != null) {
-+ toExecute.createArgument().setValue("-doctitle");
-+ toExecute.createArgument().setValue(expand(doctitle.getText()));
-+ }
-+ if (header != null) {
-+ toExecute.createArgument().setValue("-header");
-+ toExecute.createArgument().setValue(expand(header.getText()));
-+ }
-+ if (footer != null) {
-+ toExecute.createArgument().setValue("-footer");
-+ toExecute.createArgument().setValue(expand(footer.getText()));
-+ }
-+ if (bottom != null) {
-+ toExecute.createArgument().setValue("-bottom");
-+ toExecute.createArgument().setValue(expand(bottom.getText()));
-+ }
-+
-+ if (classpath == null) {
-+ classpath = (new Path(getProject())).concatSystemClasspath("last");
-+ } else {
-+ classpath = classpath.concatSystemClasspath("ignore");
-+ }
-+
-+ if (/*1.2+*/true) {
-+ if (classpath.size() > 0) {
-+ toExecute.createArgument().setValue("-classpath");
-+ toExecute.createArgument().setPath(classpath);
-+ }
-+ if (sourceDirs.size() > 0) {
-+ toExecute.createArgument().setValue("-sourcepath");
-+ toExecute.createArgument().setPath(sourceDirs);
-+ }
-+ }
-+
-+ if (version && doclet == null) {
-+ toExecute.createArgument().setValue("-version");
-+ }
-+ if (author && doclet == null) {
-+ toExecute.createArgument().setValue("-author");
-+ }
-+
-+ if (doclet == null) {
-+ if (destDir == null) {
-+ String msg = "destDir attribute must be set!";
-+ throw new BuildException(msg);
-+ }
-+ }
-+
-+ // ---------------------------- javadoc2 arguments for default doclet
-+
-+ if (/*1.2+*/true) {
-+ if (doclet != null) {
-+ if (doclet.getName() == null) {
-+ throw new BuildException("The doclet name must be "
-+ + "specified.", getLocation());
-+ } else {
-+ toExecute.createArgument().setValue("-doclet");
-+ toExecute.createArgument().setValue(doclet.getName());
-+ if (doclet.getPath() != null) {
-+ Path docletPath
-+ = doclet.getPath().concatSystemClasspath("ignore");
-+ if (docletPath.size() != 0) {
-+ toExecute.createArgument().setValue("-docletpath");
-+ toExecute.createArgument().setPath(docletPath);
-+ }
-+ }
-+ for (Enumeration e = doclet.getParams();
-+ e.hasMoreElements();) {
-+ DocletParam param = (DocletParam) e.nextElement();
-+ if (param.getName() == null) {
-+ throw new BuildException("Doclet parameters must "
-+ + "have a name");
-+ }
-+
-+ toExecute.createArgument().setValue(param.getName());
-+ if (param.getValue() != null) {
-+ toExecute.createArgument()
-+ .setValue(param.getValue());
-+ }
-+ }
-+ }
-+ }
-+ if (bootclasspath != null && bootclasspath.size() > 0) {
-+ toExecute.createArgument().setValue("-bootclasspath");
-+ toExecute.createArgument().setPath(bootclasspath);
-+ }
-+
-+ // add the links arguments
-+ if (links.size() != 0) {
-+ for (Enumeration e = links.elements(); e.hasMoreElements();) {
-+ LinkArgument la = (LinkArgument) e.nextElement();
-+
-+ if (la.getHref() == null || la.getHref().length() == 0) {
-+ log("No href was given for the link - skipping",
-+ Project.MSG_VERBOSE);
-+ continue;
-+ }
-+ String link = null;
-+ if (la.shouldResolveLink()) {
-+ File hrefAsFile =
-+ getProject().resolveFile(la.getHref());
-+ if (hrefAsFile.exists()) {
-+ try {
-+ link = fileUtils.getFileURL(hrefAsFile)
-+ .toExternalForm();
-+ } catch (MalformedURLException ex) {
-+ // should be impossible
-+ log("Warning: link location was invalid "
-+ + hrefAsFile, Project.MSG_WARN);
-+ }
-+ }
-+ }
-+ if (link == null) {
-+ // is the href a valid URL
-+ try {
-+ URL base = new URL("file://.");
-+ new URL(base, la.getHref());
-+ link = la.getHref();
-+ } catch (MalformedURLException mue) {
-+ // ok - just skip
-+ log("Link href \"" + la.getHref()
-+ + "\" is not a valid url - skipping link",
-+ Project.MSG_WARN);
-+ continue;
-+ }
-+ }
-+
-+ if (la.isLinkOffline()) {
-+ File packageListLocation = la.getPackagelistLoc();
-+ if (packageListLocation == null) {
-+ throw new BuildException("The package list "
-+ + " location for link " + la.getHref()
-+ + " must be provided because the link is "
-+ + "offline");
-+ }
-+ File packageListFile =
-+ new File(packageListLocation, "package-list");
-+ if (packageListFile.exists()) {
-+ try {
-+ String packageListURL =
-+ fileUtils.getFileURL(packageListLocation)
-+ .toExternalForm();
-+ toExecute.createArgument()
-+ .setValue("-linkoffline");
-+ toExecute.createArgument()
-+ .setValue(link);
-+ toExecute.createArgument()
-+ .setValue(packageListURL);
-+ } catch (MalformedURLException ex) {
-+ log("Warning: Package list location was "
-+ + "invalid " + packageListLocation,
-+ Project.MSG_WARN);
-+ }
-+ } else {
-+ log("Warning: No package list was found at "
-+ + packageListLocation, Project.MSG_VERBOSE);
-+ }
-+ } else {
-+ toExecute.createArgument().setValue("-link");
-+ toExecute.createArgument().setValue(link);
-+ }
-+ }
-+ }
-+
-+ // add the single group arguments
-+ // Javadoc 1.2 rules:
-+ // Multiple -group args allowed.
-+ // Each arg includes 3 strings: -group [name] [packagelist].
-+ // Elements in [packagelist] are colon-delimited.
-+ // An element in [packagelist] may end with the * wildcard.
-+
-+ // Ant javadoc task rules for group attribute:
-+ // Args are comma-delimited.
-+ // Each arg is 2 space-delimited strings.
-+ // E.g., group="XSLT_Packages org.apache.xalan.xslt*,
-+ // XPath_Packages org.apache.xalan.xpath*"
-+ if (group != null) {
-+ StringTokenizer tok = new StringTokenizer(group, ",", false);
-+ while (tok.hasMoreTokens()) {
-+ String grp = tok.nextToken().trim();
-+ int space = grp.indexOf(" ");
-+ if (space > 0) {
-+ String name = grp.substring(0, space);
-+ String pkgList = grp.substring(space + 1);
-+ toExecute.createArgument().setValue("-group");
-+ toExecute.createArgument().setValue(name);
-+ toExecute.createArgument().setValue(pkgList);
-+ }
-+ }
-+ }
-+
-+ // add the group arguments
-+ if (groups.size() != 0) {
-+ for (Enumeration e = groups.elements(); e.hasMoreElements();) {
-+ GroupArgument ga = (GroupArgument) e.nextElement();
-+ String title = ga.getTitle();
-+ String packages = ga.getPackages();
-+ if (title == null || packages == null) {
-+ throw new BuildException("The title and packages must "
-+ + "be specified for group "
-+ + "elements.");
-+ }
-+ toExecute.createArgument().setValue("-group");
-+ toExecute.createArgument().setValue(expand(title));
-+ toExecute.createArgument().setValue(packages);
-+ }
-+ }
-+
-+ // JavaDoc 1.4 parameters
-+ if (javadoc4 || executable != null) {
-+ for (Enumeration e = tags.elements(); e.hasMoreElements();) {
-+ Object element = e.nextElement();
-+ if (element instanceof TagArgument) {
-+ TagArgument ta = (TagArgument) element;
-+ File tagDir = ta.getDir(getProject());
-+ if (tagDir == null) {
-+ // The tag element is not used as a fileset,
-+ // but specifies the tag directly.
-+ toExecute.createArgument().setValue ("-tag");
-+ toExecute.createArgument().setValue (ta.getParameter());
-+ } else {
-+ // The tag element is used as a fileset. Parse all the files and
-+ // create -tag arguments.
-+ DirectoryScanner tagDefScanner = ta.getDirectoryScanner(getProject());
-+ String[] files = tagDefScanner.getIncludedFiles();
-+ for (int i = 0; i < files.length; i++) {
-+ File tagDefFile = new File(tagDir, files[i]);
-+ try {
-+ BufferedReader in
-+ = new BufferedReader(new FileReader(tagDefFile));
-+ String line = null;
-+ while ((line = in.readLine()) != null) {
-+ toExecute.createArgument().setValue ("-tag");
-+ toExecute.createArgument().setValue (line);
-+ }
-+ in.close();
-+ } catch (IOException ioe) {
-+ throw new BuildException("Couldn't read "
-+ + " tag file from "
-+ + tagDefFile.getAbsolutePath(), ioe);
-+ }
-+ }
-+ }
-+ } else {
-+ ExtensionInfo tagletInfo = (ExtensionInfo) element;
-+ toExecute.createArgument().setValue("-taglet");
-+ toExecute.createArgument().setValue(tagletInfo
-+ .getName());
-+ if (tagletInfo.getPath() != null) {
-+ Path tagletPath = tagletInfo.getPath()
-+ .concatSystemClasspath("ignore");
-+ if (tagletPath.size() != 0) {
-+ toExecute.createArgument()
-+ .setValue("-tagletpath");
-+ toExecute.createArgument().setPath(tagletPath);
-+ }
-+ }
-+ }
-+ }
-+
-+ if (source != null) {
-+ toExecute.createArgument().setValue("-source");
-+ toExecute.createArgument().setValue(source);
-+ }
-+
-+ if (linksource && doclet == null) {
-+ toExecute.createArgument().setValue("-linksource");
-+ }
-+ if (breakiterator && doclet == null) {
-+ toExecute.createArgument().setValue("-breakiterator");
-+ }
-+ if (noqualifier != null && doclet == null) {
-+ toExecute.createArgument().setValue("-noqualifier");
-+ toExecute.createArgument().setValue(noqualifier);
-+ }
-+ } else {
-+ // Not 1.4+.
-+ if (!tags.isEmpty()) {
-+ log("-tag and -taglet options not supported on Javadoc < 1.4",
-+ Project.MSG_VERBOSE);
-+ }
-+ if (source != null) {
-+ log("-source option not supported on JavaDoc < 1.4",
-+ Project.MSG_VERBOSE);
-+ }
-+ if (linksource) {
-+ log("-linksource option not supported on JavaDoc < 1.4",
-+ Project.MSG_VERBOSE);
-+ }
-+ if (breakiterator) {
-+ log("-breakiterator option not supported on JavaDoc < 1.4",
-+ Project.MSG_VERBOSE);
-+ }
-+ if (noqualifier != null) {
-+ log("-noqualifier option not supported on JavaDoc < 1.4",
-+ Project.MSG_VERBOSE);
-+ }
-+ }
-+ // Javadoc 1.2/1.3 parameters:
-+ if (!javadoc4 || executable != null) {
-+ if (old) {
-+ toExecute.createArgument().setValue("-1.1");
-+ }
-+ } else {
-+ if (old) {
-+ log("Javadoc 1.4 doesn't support the -1.1 switch anymore",
-+ Project.MSG_WARN);
-+ }
-+ }
-+
-+ }
-+
-+ File tmpList = null;
-+ PrintWriter srcListWriter = null;
-+ try {
-+
-+ /**
-+ * Write sourcefiles and package names to a temporary file
-+ * if requested.
-+ */
-+ if (useExternalFile) {
-+ if (tmpList == null) {
-+ tmpList = fileUtils.createTempFile("javadoc", "", null);
-+ tmpList.deleteOnExit();
-+ toExecute.createArgument()
-+ .setValue("@" + tmpList.getAbsolutePath());
-+ }
-+ srcListWriter = new PrintWriter(
-+ new FileWriter(tmpList.getAbsolutePath(),
-+ true));
-+ }
-+
-+ Enumeration e = packagesToDoc.elements();
-+ while (e.hasMoreElements()) {
-+ String packageName = (String) e.nextElement();
-+ if (useExternalFile) {
-+ srcListWriter.println(packageName);
-+ } else {
-+ toExecute.createArgument().setValue(packageName);
-+ }
-+ }
-+
-+ e = sourceFilesToDoc.elements();
-+ while (e.hasMoreElements()) {
-+ SourceFile sf = (SourceFile) e.nextElement();
-+ String sourceFileName = sf.getFile().getAbsolutePath();
-+ if (useExternalFile) {
-+ if (javadoc4 && sourceFileName.indexOf(" ") > -1) {
-+ srcListWriter.println("\"" + sourceFileName + "\"");
-+ } else {
-+ srcListWriter.println(sourceFileName);
-+ }
-+ } else {
-+ toExecute.createArgument().setValue(sourceFileName);
-+ }
-+ }
-+
-+ } catch (IOException e) {
-+ tmpList.delete();
-+ throw new BuildException("Error creating temporary file",
-+ e, getLocation());
-+ } finally {
-+ if (srcListWriter != null) {
-+ srcListWriter.close();
-+ }
-+ }
-+
-+ if (packageList != null) {
-+ toExecute.createArgument().setValue("@" + packageList);
-+ }
-+ log(toExecute.describeCommand(), Project.MSG_VERBOSE);
-+
-+ log("Javadoc execution through Gjdoc", Project.MSG_INFO);
-+
-+ JavadocOutputStream out = new JavadocOutputStream(Project.MSG_INFO);
-+ JavadocOutputStream err = new JavadocOutputStream(Project.MSG_WARN);
-+
-+ Execute exe = new Execute(new PumpStreamHandler(out, err));
-+ exe.setAntRun(getProject());
-+
-+ String[] env = exe.getEnvironment();
-+ String javahome = System.getProperty("java.home");
-+ // setting the JAVA_HOME variable in the process execution environment
-+ // needed as otherwise gjdoc will go to kaffe by default
-+ log("Setting JAVA_HOME environment variable for the gjdoc executable process to: "+ javahome, Project.MSG_VERBOSE);
-+ if(env != null) {
-+ for(int i=0; i < env.length; i++) {
-+ if( env[i].startsWith("JAVA_HOME") )
-+ env[i] = "JAVA_HOME=" + javahome;
-+ }
-+ }
-+ else
-+ exe.setEnvironment(new String[] {"JAVA_HOME=" + javahome });
-+
-+ /*
-+ * No reason to change the working directory as all filenames and
-+ * path components have been resolved already.
-+ *
-+ * Avoid problems with command line length in some environments.
-+ */
-+ exe.setWorkingDirectory(null);
-+ try {
-+ exe.setCommandline(toExecute.getCommandline());
-+ int ret = exe.execute();
-+ if (ret != 0 && failOnError) {
-+ throw new BuildException("Gjdoc returned " + ret, getLocation());
-+ }
-+ } catch (IOException e) {
-+ throw new BuildException("Gjdoc failed: " + e, e, getLocation());
-+ } finally {
-+ if (tmpList != null) {
-+ tmpList.delete();
-+ tmpList = null;
-+ }
-+
-+ out.logFlush();
-+ err.logFlush();
-+ try {
-+ out.close();
-+ err.close();
-+ } catch (IOException e) {
-+ // ignore
-+ }
-+ }
-+ }
-+
-+ /**
-+ * Add the files matched by the nested filesets to the Vector as
-+ * SourceFile instances.
-+ *
-+ * @since 1.5
-+ */
-+ private void addFileSets(Vector sf) {
-+ Enumeration e = fileSets.elements();
-+ while (e.hasMoreElements()) {
-+ FileSet fs = (FileSet) e.nextElement();
-+ if (!fs.hasPatterns() && !fs.hasSelectors()) {
-+ fs = (FileSet) fs.clone();
-+ fs.createInclude().setName("**/*.java");
-+ if (includeNoSourcePackages) {
-+ fs.createInclude().setName("**/package.html");
-+ }
-+ }
-+ File baseDir = fs.getDir(getProject());
-+ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
-+ String[] files = ds.getIncludedFiles();
-+ for (int i = 0; i < files.length; i++) {
-+ sf.addElement(new SourceFile(new File(baseDir, files[i])));
-+ }
-+ }
-+ }
-+
-+ /**
-+ * Add the directories matched by the nested dirsets to the Vector
-+ * and the base directories of the dirsets to the Path. It also
-+ * handles the packages and excludepackages attributes and
-+ * elements.
-+ *
-+ * @since 1.5
-+ */
-+ private void parsePackages(Vector pn, Path sp) {
-+ Vector addedPackages = new Vector();
-+ Vector dirSets = (Vector) packageSets.clone();
-+
-+ // for each sourcePath entry, add a directoryset with includes
-+ // taken from packagenames attribute and nested package
-+ // elements and excludes taken from excludepackages attribute
-+ // and nested excludepackage elements
-+ if (sourcePath != null && packageNames.size() > 0) {
-+ PatternSet ps = new PatternSet();
-+ Enumeration e = packageNames.elements();
-+ while (e.hasMoreElements()) {
-+ PackageName p = (PackageName) e.nextElement();
-+ String pkg = p.getName().replace('.', '/');
-+ if (pkg.endsWith("*")) {
-+ pkg += "*";
-+ }
-+ ps.createInclude().setName(pkg);
-+ }
-+
-+ e = excludePackageNames.elements();
-+ while (e.hasMoreElements()) {
-+ PackageName p = (PackageName) e.nextElement();
-+ String pkg = p.getName().replace('.', '/');
-+ if (pkg.endsWith("*")) {
-+ pkg += "*";
-+ }
-+ ps.createExclude().setName(pkg);
-+ }
-+
-+
-+ String[] pathElements = sourcePath.list();
-+ for (int i = 0; i < pathElements.length; i++) {
-+ DirSet ds = new DirSet();
-+ ds.setDefaultexcludes(useDefaultExcludes);
-+ ds.setDir(new File(pathElements[i]));
-+ ds.createPatternSet().addConfiguredPatternset(ps);
-+ dirSets.addElement(ds);
-+ }
-+ }
-+
-+ Enumeration e = dirSets.elements();
-+ while (e.hasMoreElements()) {
-+ DirSet ds = (DirSet) e.nextElement();
-+ File baseDir = ds.getDir(getProject());
-+ log("scanning " + baseDir + " for packages.", Project.MSG_DEBUG);
-+ DirectoryScanner dsc = ds.getDirectoryScanner(getProject());
-+ String[] dirs = dsc.getIncludedDirectories();
-+ boolean containsPackages = false;
-+ for (int i = 0; i < dirs.length; i++) {
-+ // are there any java files in this directory?
-+ File pd = new File(baseDir, dirs[i]);
-+ String[] files = pd.list(new FilenameFilter () {
-+ public boolean accept(File dir1, String name) {
-+ return name.endsWith(".java")
-+ || (includeNoSourcePackages
-+ && name.equals("package.html"));
-+ }
-+ });
-+
-+ if (files.length > 0) {
-+ containsPackages = true;
-+ String packageName =
-+ dirs[i].replace(File.separatorChar, '.');
-+ if (!addedPackages.contains(packageName)) {
-+ addedPackages.addElement(packageName);
-+ pn.addElement(packageName);
-+ }
-+ }
-+ }
-+ if (containsPackages) {
-+ // We don't need to care for duplicates here,
-+ // Path.list does it for us.
-+ sp.createPathElement().setLocation(baseDir);
-+ } else {
-+ log(baseDir + " doesn\'t contain any packages, dropping it.",
-+ Project.MSG_VERBOSE);
-+ }
-+ }
-+ }
-+
-+ private class JavadocOutputStream extends LogOutputStream {
-+ JavadocOutputStream(int level) {
-+ super(Gjdoc.this, level);
-+ }
-+
-+ //
-+ // Override the logging of output in order to filter out Generating
-+ // messages. Generating messages are set to a priority of VERBOSE
-+ // unless they appear after what could be an informational message.
-+ //
-+ private String queuedLine = null;
-+ protected void processLine(String line, int messageLevel) {
-+ if (messageLevel == Project.MSG_INFO
-+ && line.startsWith("Generating ")) {
-+ if (queuedLine != null) {
-+ super.processLine(queuedLine, Project.MSG_VERBOSE);
-+ }
-+ queuedLine = line;
-+ } else {
-+ if (queuedLine != null) {
-+ if (line.startsWith("Building ")) {
-+ super.processLine(queuedLine, Project.MSG_VERBOSE);
-+ } else {
-+ super.processLine(queuedLine, Project.MSG_INFO);
-+ }
-+ queuedLine = null;
-+ }
-+ super.processLine(line, messageLevel);
-+ }
-+ }
-+
-+
-+ protected void logFlush() {
-+ if (queuedLine != null) {
-+ super.processLine(queuedLine, Project.MSG_VERBOSE);
-+ queuedLine = null;
-+ }
-+ }
-+ }
-+
-+ /**
-+ * Convenience method to expand properties.
-+ */
-+ protected String expand(String content) {
-+ return getProject().replaceProperties(content);
-+ }
-+
-+}
Deleted: trunk/ant/debian/patches/01_javadoc_maxmemory.patch
===================================================================
--- trunk/ant/debian/patches/01_javadoc_maxmemory.patch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/patches/01_javadoc_maxmemory.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,18 +0,0 @@
---- build.xml.orig 2007-07-07 08:07:25.000000000 -0100
-+++ build.xml 2007-07-07 08:08:25.000000000 -0100
-@@ -1480,6 +1480,7 @@
- version="true"
- locale="en"
- windowtitle="${Name} API"
-+ maxmemory="256m"
- doctitle="${Name}"
- verbose="${javadoc.verbose}">
-
-@@ -1512,6 +1513,7 @@
- version="true"
- locale="en"
- windowtitle="${Name} Test Utilities"
-+ maxmemory="256m"
- doctitle="${Name}">
-
- <!-- hide some meta information for javadoc -->
Deleted: trunk/ant/debian/patches/02_ant_add_xerces.patch
===================================================================
--- trunk/ant/debian/patches/02_ant_add_xerces.patch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/patches/02_ant_add_xerces.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,16 +0,0 @@
---- src/script/ant.orig 2005-06-23 16:05:20.000000000 +0200
-+++ src/script/ant 2005-06-23 16:04:20.000000000 +0200
-@@ -125,6 +125,13 @@
- exit 1
- fi
-
-+# Add the Xerces 2 XML parser in the Debian version
-+if [ -z "$LOCALCLASSPATH" ] ; then
-+ LOCALCLASSPATH="/usr/share/java/xmlParserAPIs.jar:/usr/share/java/xercesImpl.jar"
-+else
-+ LOCALCLASSPATH="/usr/share/java/xmlParserAPIs.jar:/usr/share/java/xercesImpl.jar:$LOCALCLASSPATH"
-+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
Deleted: trunk/ant/debian/patches/03_SplashTaskPatch_a.patch
===================================================================
(Binary files differ)
Deleted: trunk/ant/debian/patches/04_no_test-jars.patch
===================================================================
--- trunk/ant/debian/patches/04_no_test-jars.patch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/patches/04_no_test-jars.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,11 +0,0 @@
---- build.xml.orig 2007-07-07 22:28:33.000000000 +0200
-+++ build.xml 2007-07-07 22:28:55.000000000 +0200
-@@ -924,7 +924,7 @@
- ===================================================================
- -->
- <target name="dist-lite"
-- depends="jars,test-jar"
-+ depends="jars"
- description="--> creates a minimum distribution to run Apache Ant">
-
- <mkdir dir="${dist.dir}"/>
Deleted: trunk/ant/debian/patches/06_ant-source-target-version.patch
===================================================================
--- trunk/ant/debian/patches/06_ant-source-target-version.patch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/patches/06_ant-source-target-version.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,13 +0,0 @@
---- build.xml.orig 2007-08-24 19:40:15.000000000 +0200
-+++ build.xml 2007-08-24 19:40:32.000000000 +0200
-@@ -64,8 +64,8 @@
- <property name="chmod.maxparallel" value="250"/>
- <property name="deprecation" value="false"/>
- <property name="optimize" value="true"/>
-- <property name="javac.target" value="1.2"/>
-- <property name="javac.source" value="1.2"/>
-+ <property name="javac.target" value="1.3"/>
-+ <property name="javac.source" value="1.3"/>
- <property name="junit.fork" value="false"/>
- <property name="junit.filtertrace" value="off"/>
- <property name="junit.summary" value="no"/>
Deleted: trunk/ant/debian/patches/10_ant_native2ascii.patch
===================================================================
--- trunk/ant/debian/patches/10_ant_native2ascii.patch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/patches/10_ant_native2ascii.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,67 +0,0 @@
---- src/main/org/apache/tools/ant/util/JavaEnvUtils.java.orig
-+++ src/main/org/apache/tools/ant/util/JavaEnvUtils.java
-@@ -73,6 +73,9 @@
- /** Whether this is the Kaffe VM */
- private static boolean kaffeDetected;
-
-+ /** Wheter this is a GNU Classpath based VM */
-+ private static boolean classpathDetected;
-+
- /** array of packages in the runtime */
- private static Vector jrePackages;
-
-@@ -119,6 +122,13 @@
- } catch (Throwable t) {
- // swallow as this simply doesn't seem to be Kaffe
- }
-+ classpathDetected = false;
-+ try {
-+ Class.forName("gnu.classpath.Configuration");
-+ classpathDetected = true;
-+ } catch (Throwable t) {
-+ // swallow as this simply doesn't seem to be GNU classpath based.
-+ }
- }
-
- /**
-@@ -179,6 +189,10 @@
- return kaffeDetected;
- }
-
-+ public static boolean isClasspathBased() {
-+ return classpathDetected;
-+ }
-+
- /**
- * Finds an executable that is part of a JRE installation based on
- * the java.home system property.
---- src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/KaffeNative2Ascii.java.orig
-+++ src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/KaffeNative2Ascii.java
-@@ -32,6 +32,7 @@
-
- // sorted by newest Kaffe version first
- private static final String[] N2A_CLASSNAMES = new String[] {
-+ "gnu.classpath.tools.native2ascii.Native2ASCII",
- "gnu.classpath.tools.native2ascii.Native2Ascii",
- // pre Kaffe 1.1.5
- "kaffe.tools.native2ascii.Native2Ascii",
---- src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java.orig
-+++ src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java
-@@ -38,7 +38,7 @@
- * vendor
- */
- public static String getDefault() {
-- if (JavaEnvUtils.isKaffe()) {
-+ if (JavaEnvUtils.isKaffe() || JavaEnvUtils.isClasspathBased()) {
- return KaffeNative2Ascii.IMPLEMENTATION_NAME;
- }
- return SunNative2Ascii.IMPLEMENTATION_NAME;
-@@ -57,7 +57,7 @@
- public static Native2AsciiAdapter getAdapter(String choice,
- ProjectComponent log)
- throws BuildException {
-- if ((JavaEnvUtils.isKaffe() && choice == null)
-+ if (((JavaEnvUtils.isKaffe() || JavaEnvUtils.isClasspathBased()) && choice == null)
- || KaffeNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
- return new KaffeNative2Ascii();
- } else if (SunNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
Deleted: trunk/ant/debian/patches/11_ant_underscore_dash_fix.patch
===================================================================
--- trunk/ant/debian/patches/11_ant_underscore_dash_fix.patch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/patches/11_ant_underscore_dash_fix.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,12 +0,0 @@
-diff -Nru ant-1.7.1.orig/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java ant-1.7.1/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java
---- ant-1.7.1.orig/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java 2008-11-10 10:50:29.000000000 -0600
-+++ ant-1.7.1/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java 2008-11-10 10:50:49.000000000 -0600
-@@ -120,7 +120,7 @@
- : rpmBuildCommand);
- if (topDir != null) {
- toExecute.createArgument().setValue("--define");
-- toExecute.createArgument().setValue("_topdir" + topDir);
-+ toExecute.createArgument().setValue("_topdir " + topDir);
- }
-
- toExecute.createArgument().setLine(command);
Added: trunk/ant/debian/patches/ant-source-target-version.patch
===================================================================
--- trunk/ant/debian/patches/ant-source-target-version.patch (rev 0)
+++ trunk/ant/debian/patches/ant-source-target-version.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,13 @@
+--- a/build.xml
++++ b/build.xml
+@@ -102,8 +102,8 @@
+ <property name="chmod.maxparallel" value="250"/>
+ <property name="deprecation" value="false"/>
+ <property name="optimize" value="true"/>
+- <property name="javac.target" value="1.2"/>
+- <property name="javac.source" value="1.2"/>
++ <property name="javac.target" value="1.3"/>
++ <property name="javac.source" value="1.3"/>
+ <property name="junit.fork" value="false"/>
+ <property name="junit.filtertrace" value="off"/>
+ <property name="junit.summary" value="no"/>
Added: trunk/ant/debian/patches/ant_add_xerces.patch
===================================================================
--- trunk/ant/debian/patches/ant_add_xerces.patch (rev 0)
+++ trunk/ant/debian/patches/ant_add_xerces.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,16 @@
+--- a/src/script/ant 2005-06-23 16:05:20.000000000 +0200
++++ b/src/script/ant 2005-06-23 16:04:20.000000000 +0200
+@@ -125,6 +125,13 @@
+ exit 1
+ fi
+
++# Add the Xerces 2 XML parser in the Debian version
++if [ -z "$LOCALCLASSPATH" ] ; then
++ LOCALCLASSPATH="/usr/share/java/xmlParserAPIs.jar:/usr/share/java/xercesImpl.jar"
++else
++ LOCALCLASSPATH="/usr/share/java/xmlParserAPIs.jar:/usr/share/java/xercesImpl.jar:$LOCALCLASSPATH"
++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
Added: trunk/ant/debian/patches/ant_home_path.patch
===================================================================
--- trunk/ant/debian/patches/ant_home_path.patch (rev 0)
+++ trunk/ant/debian/patches/ant_home_path.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,31 @@
+--- a/src/script/ant
++++ b/src/script/ant
+@@ -92,25 +92,9 @@
+ esac
+
+ if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then
+- ## 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" > /dev/null && pwd`
++ if [ -d /usr/share/ant ] ; then
++ ANT_HOME=/usr/share/ant
++ fi
+ fi
+
+ # For Cygwin and Mingw, ensure paths are in UNIX format before
Added: trunk/ant/debian/patches/ant_native2ascii.patch
===================================================================
--- trunk/ant/debian/patches/ant_native2ascii.patch (rev 0)
+++ trunk/ant/debian/patches/ant_native2ascii.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,67 @@
+--- a/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/KaffeNative2Ascii.java
++++ b/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/KaffeNative2Ascii.java
+@@ -32,6 +32,7 @@
+
+ // sorted by newest Kaffe version first
+ private static final String[] N2A_CLASSNAMES = new String[] {
++ "gnu.classpath.tools.native2ascii.Native2ASCII",
+ "gnu.classpath.tools.native2ascii.Native2Ascii",
+ // pre Kaffe 1.1.5
+ "kaffe.tools.native2ascii.Native2Ascii",
+--- a/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java
++++ b/src/main/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java
+@@ -40,7 +40,7 @@
+ * vendor
+ */
+ public static String getDefault() {
+- if (JavaEnvUtils.isKaffe()) {
++ if (JavaEnvUtils.isKaffe() || JavaEnvUtils.isClasspathBased()) {
+ return KaffeNative2Ascii.IMPLEMENTATION_NAME;
+ }
+ return SunNative2Ascii.IMPLEMENTATION_NAME;
+@@ -79,7 +79,7 @@
+ ProjectComponent log,
+ Path classpath)
+ throws BuildException {
+- if ((JavaEnvUtils.isKaffe() && choice == null)
++ if (((JavaEnvUtils.isKaffe() || JavaEnvUtils.isClasspathBased()) && choice == null)
+ || KaffeNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
+ return new KaffeNative2Ascii();
+ } else if (SunNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
+--- a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
++++ b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
+@@ -91,6 +91,9 @@
+
+ /** Whether this is the Kaffe VM */
+ private static boolean kaffeDetected;
++
++ /** Wheter this is a GNU Classpath based VM */
++ private static boolean classpathDetected;
+
+ /** array of packages in the runtime */
+ private static Vector jrePackages;
+@@ -138,6 +141,13 @@
+ } catch (Throwable t) {
+ // swallow as this simply doesn't seem to be Kaffe
+ }
++ classpathDetected = false;
++ try {
++ Class.forName("gnu.classpath.Configuration");
++ classpathDetected = true;
++ } catch (Throwable t) {
++ // swallow as this simply doesn't seem to be GNU classpath based.
++ }
+ }
+
+ /**
+@@ -197,6 +207,10 @@
+ public static boolean isKaffe() {
+ return kaffeDetected;
+ }
++
++ public static boolean isClasspathBased() {
++ return classpathDetected;
++ }
+
+ /**
+ * Finds an executable that is part of a JRE installation based on
Added: trunk/ant/debian/patches/build-path.patch
===================================================================
--- trunk/ant/debian/patches/build-path.patch (rev 0)
+++ trunk/ant/debian/patches/build-path.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,11 @@
+--- a/build.xml
++++ b/build.xml
+@@ -120,7 +120,7 @@
+ ===================================================================
+ -->
+ <path id="classpath">
+- <fileset dir="lib/optional" includes="*.jar"/>
++ <pathelement path="${build.classpath}"/>
+ </path>
+
+ <path id="tests-classpath">
Added: trunk/ant/debian/patches/gjdoc_task.patch
===================================================================
--- trunk/ant/debian/patches/gjdoc_task.patch (rev 0)
+++ trunk/ant/debian/patches/gjdoc_task.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,2159 @@
+--- a/src/main/org/apache/tools/ant/taskdefs/defaults.properties
++++ b/src/main/org/apache/tools/ant/taskdefs/defaults.properties
+@@ -63,6 +63,7 @@
+ java=org.apache.tools.ant.taskdefs.Java
+ javac=org.apache.tools.ant.taskdefs.Javac
+ javadoc=org.apache.tools.ant.taskdefs.Javadoc
++gjdoc=org.apache.tools.ant.taskdefs.Gjdoc
+ length=org.apache.tools.ant.taskdefs.Length
+ loadfile=org.apache.tools.ant.taskdefs.LoadFile
+ loadproperties=org.apache.tools.ant.taskdefs.LoadProperties
+--- /dev/null
++++ b/main/org/apache/tools/ant/taskdefs/Gjdoc.java
+@@ -0,0 +1,2146 @@
++/*
++ * Copyright 2000-2005 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.
++ *
++ */
++package org.apache.tools.ant.taskdefs;
++
++import java.io.File;
++import java.io.FileWriter;
++import java.io.FilenameFilter;
++import java.io.IOException;
++import java.io.PrintWriter;
++import java.io.BufferedReader;
++import java.io.FileReader;
++import java.net.MalformedURLException;
++import java.net.URL;
++import java.util.Enumeration;
++import java.util.Locale;
++import java.util.StringTokenizer;
++import java.util.Vector;
++import org.apache.tools.ant.BuildException;
++import org.apache.tools.ant.DirectoryScanner;
++import org.apache.tools.ant.Project;
++import org.apache.tools.ant.ProjectComponent;
++import org.apache.tools.ant.Task;
++import org.apache.tools.ant.types.Commandline;
++import org.apache.tools.ant.types.DirSet;
++import org.apache.tools.ant.types.EnumeratedAttribute;
++import org.apache.tools.ant.types.FileSet;
++import org.apache.tools.ant.types.Path;
++import org.apache.tools.ant.types.PatternSet;
++import org.apache.tools.ant.types.Reference;
++import org.apache.tools.ant.util.FileUtils;
++import org.apache.tools.ant.util.JavaEnvUtils;
++
++/**
++ * Generates Javadoc documentation for a collection
++ * of source code. It used the Gjdoc tool from GNU classpath.
++ *
++ * <P>Current known limitations are:
++ *
++ * <P><UL>
++ * <LI>patterns must be of the form "xxx.*", every other pattern doesn't
++ * work.
++ * <LI>there is no control on arguments sanity since they are left
++ * to the javadoc implementation.
++ * </UL>
++ *
++ * <P>If no <CODE>doclet</CODE> is set, then the <CODE>version</CODE> and
++ * <CODE>author</CODE> are by default <CODE>"yes"</CODE>.
++ *
++ * <P>Note: This task is run on another VM because the Javadoc code calls
++ * <CODE>System.exit()</CODE> which would break Ant functionality.
++ *
++ *
++ * @since Ant 1.1
++ *
++ * @ant.task category="java"
++ */
++public class Gjdoc extends Task {
++ /**
++ * Inner class used to manage doclet parameters.
++ */
++ public class DocletParam {
++ /** The parameter name */
++ private String name;
++
++ /** The parameter value */
++ private String value;
++
++ /**
++ * Set the name of the parameter.
++ *
++ * @param name the name of the doclet parameter
++ */
++ public void setName(String name) {
++ this.name = name;
++ }
++
++ /**
++ * Get the parameter name.
++ *
++ * @return the parameter's name.
++ */
++ public String getName() {
++ return name;
++ }
++
++ /**
++ * Set the parameter value.
++ *
++ * Note that only string values are supported. No resolution of file
++ * paths is performed.
++ *
++ * @param value the parameter value.
++ */
++ public void setValue(String value) {
++ this.value = value;
++ }
++
++ /**
++ * Get the parameter value.
++ *
++ * @return the parameter value.
++ */
++ public String getValue() {
++ return value;
++ }
++ }
++
++ /**
++ * A project aware class used for Javadoc extensions which take a name
++ * and a path such as doclet and taglet arguments.
++ *
++ */
++ public static class ExtensionInfo extends ProjectComponent {
++ /** The name of the extension */
++ private String name;
++
++ /** The optional path to use to load the extension */
++ private Path path;
++
++ /**
++ * Set the name of the extension
++ *
++ * @param name the extension's name.
++ */
++ public void setName(String name) {
++ this.name = name;
++ }
++
++ /**
++ * Get the name of the extension.
++ *
++ * @return the extension's name.
++ */
++ public String getName() {
++ return name;
++ }
++
++ /**
++ * Set the path to use when loading the component.
++ *
++ * @param path a Path instance containing the classpath to use.
++ */
++ public void setPath(Path path) {
++ if (this.path == null) {
++ this.path = path;
++ } else {
++ this.path.append(path);
++ }
++ }
++
++ /**
++ * Get the extension's path.
++ *
++ * @return the path to be used to load the extension.
++ * May be <code>null</code>
++ */
++ public Path getPath() {
++ return path;
++ }
++
++ /**
++ * Create an empty nested path to be configured by Ant with the
++ * classpath for the extension.
++ *
++ * @return a new Path instance to be configured.
++ */
++ public Path createPath() {
++ if (path == null) {
++ path = new Path(getProject());
++ }
++ return path.createPath();
++ }
++
++ /**
++ * Adds a reference to a CLASSPATH defined elsewhere.
++ *
++ * @param r the reference containing the path.
++ */
++ public void setPathRef(Reference r) {
++ createPath().setRefid(r);
++ }
++ }
++
++ /**
++ * This class stores info about doclets.
++ *
++ */
++ public class DocletInfo extends ExtensionInfo {
++
++ /** Collection of doclet parameters. */
++ private Vector params = new Vector();
++
++ /**
++ * Create a doclet parameter to be configured by Ant.
++ *
++ * @return a new DocletParam instance to be configured.
++ */
++ public DocletParam createParam() {
++ DocletParam param = new DocletParam();
++ params.addElement(param);
++
++ return param;
++ }
++
++ /**
++ * Get the doclet's parameters.
++ *
++ * @return an Enumeration of DocletParam instances.
++ */
++ public Enumeration getParams() {
++ return params.elements();
++ }
++ }
++
++ /**
++ * Used to track info about the packages to be javadoc'd
++ */
++ public static class PackageName {
++ /** The package name */
++ private String name;
++
++ /**
++ * Set the name of the package
++ *
++ * @param name the package name.
++ */
++ public void setName(String name) {
++ this.name = name.trim();
++ }
++
++ /**
++ * Get the package name.
++ *
++ * @return the package's name.
++ */
++ public String getName() {
++ return name;
++ }
++
++ /**
++ * @see java.lang.Object#toString
++ */
++ public String toString() {
++ return getName();
++ }
++ }
++
++ /**
++ * This class is used to manage the source files to be processed.
++ */
++ public static class SourceFile {
++ /** The source file */
++ private File file;
++
++ /**
++ * Default constructor
++ */
++ public SourceFile() {
++ }
++
++ /**
++ * Constructor specifying the source file directly
++ *
++ * @param file the source file
++ */
++ public SourceFile(File file) {
++ this.file = file;
++ }
++
++ /**
++ * Set the source file.
++ *
++ * @param file the source file.
++ */
++ public void setFile(File file) {
++ this.file = file;
++ }
++
++ /**
++ * Get the source file.
++ *
++ * @return the source file.
++ */
++ public File getFile() {
++ return file;
++ }
++ }
++
++ /**
++ * An HTML element in the javadoc.
++ *
++ * This class is used for those javadoc elements which contain HTML such as
++ * footers, headers, etc.
++ */
++ public static class Html {
++ /** The text for the element */
++ private StringBuffer text = new StringBuffer();
++
++ /**
++ * Add text to the element.
++ *
++ * @param t the text to be added.
++ */
++ public void addText(String t) {
++ text.append(t);
++ }
++
++ /**
++ * Get the current text for the element.
++ *
++ * @return the current text.
++ */
++ public String getText() {
++ return text.substring(0);
++ }
++ }
++
++ /**
++ * EnumeratedAttribute implementation supporting the javadoc scoping
++ * values.
++ */
++ public static class AccessType extends EnumeratedAttribute {
++ /**
++ * @see EnumeratedAttribute#getValues().
++ */
++ public String[] getValues() {
++ // Protected first so if any GUI tool offers a default
++ // based on enum #0, it will be right.
++ return new String[] {"protected", "public", "package", "private"};
++ }
++ }
++
++ /** The command line built to execute Javadoc. */
++ private Commandline cmd = new Commandline();
++
++ /**
++ * Utility method to add an argument to the command line conditionally
++ * based on the given flag.
++ *
++ * @param b the flag which controls if the argument is added.
++ * @param arg the argument value.
++ */
++ private void addArgIf(boolean b, String arg) {
++ if (b) {
++ cmd.createArgument().setValue(arg);
++ }
++ }
++
++ /**
++ * Utility method to add a javadoc argument.
++ *
++ * @param key the argument name.
++ * @param value the argument value.
++ */
++ private void addArgIfNotEmpty(String key, String value) {
++ if (value != null && value.length() != 0) {
++ cmd.createArgument().setValue(key);
++ cmd.createArgument().setValue(value);
++ } else {
++ log("Warning: Leaving out empty argument '" + key + "'",
++ Project.MSG_WARN);
++ }
++ }
++
++ /**
++ * Flag which indicates if the task should fail if there is a
++ * javadoc error.
++ */
++ private boolean failOnError = false;
++ private Path sourcePath = null;
++ private File destDir = null;
++ private Vector sourceFiles = new Vector();
++ private Vector packageNames = new Vector();
++ private Vector excludePackageNames = new Vector(1);
++ private boolean author = true;
++ private boolean version = true;
++ private DocletInfo doclet = null;
++ private Path classpath = null;
++ private Path bootclasspath = null;
++ private String group = null;
++ private String packageList = null;
++ private Vector links = new Vector();
++ private Vector groups = new Vector();
++ private Vector tags = new Vector();
++ private boolean useDefaultExcludes = true;
++ private Html doctitle = null;
++ private Html header = null;
++ private Html footer = null;
++ private Html bottom = null;
++ private boolean useExternalFile = false;
++ private FileUtils fileUtils = FileUtils.newFileUtils();
++ private String source = null;
++ private boolean linksource = false;
++ private boolean breakiterator = false;
++ private String noqualifier;
++ private boolean includeNoSourcePackages = false;
++ private boolean old = false;
++ private String executable = null;
++
++ private Vector fileSets = new Vector();
++ private Vector packageSets = new Vector();
++
++ /**
++ * Work around command line length limit by using an external file
++ * for the sourcefiles.
++ *
++ * @param b true if an external file is to be used.
++ */
++ public void setUseExternalFile(boolean b) {
++ useExternalFile = b;
++ }
++
++ /**
++ * Sets whether default exclusions should be used or not.
++ *
++ * @param useDefaultExcludes "true"|"on"|"yes" when default exclusions
++ * should be used, "false"|"off"|"no" when they
++ * shouldn't be used.
++ */
++ public void setDefaultexcludes(boolean useDefaultExcludes) {
++ this.useDefaultExcludes = useDefaultExcludes;
++ }
++
++ /**
++ * Set the maximum memory to be used by the javadoc process
++ *
++ * @param max a string indicating the maximum memory according to the
++ * JVM conventions (e.g. 128m is 128 Megabytes)
++ */
++ public void setMaxmemory(String max) {
++ cmd.createArgument().setValue("-J-Xmx" + max);
++ }
++
++ /**
++ * Set an additional parameter on the command line
++ *
++ * @param add the additional command line parameter for the javadoc task.
++ */
++ public void setAdditionalparam(String add) {
++ cmd.createArgument().setLine(add);
++ }
++
++ /**
++ * Adds a command-line argument.
++ * @since Ant 1.6
++ */
++ public Commandline.Argument createArg() {
++ return cmd.createArgument();
++ }
++
++ /**
++ * Specify where to find source file
++ *
++ * @param src a Path instance containing the various source directories.
++ */
++ public void setSourcepath(Path src) {
++ if (sourcePath == null) {
++ sourcePath = src;
++ } else {
++ sourcePath.append(src);
++ }
++ }
++
++ /**
++ * Create a path to be configured with the locations of the source
++ * files.
++ *
++ * @return a new Path instance to be configured by the Ant core.
++ */
++ public Path createSourcepath() {
++ if (sourcePath == null) {
++ sourcePath = new Path(getProject());
++ }
++ return sourcePath.createPath();
++ }
++
++ /**
++ * Adds a reference to a CLASSPATH defined elsewhere.
++ *
++ * @param r the reference containing the source path definition.
++ */
++ public void setSourcepathRef(Reference r) {
++ createSourcepath().setRefid(r);
++ }
++
++ /**
++ * Set the directory where the Javadoc output will be generated.
++ *
++ * @param dir the destination directory.
++ */
++ public void setDestdir(File dir) {
++ destDir = dir;
++ cmd.createArgument().setValue("-d");
++ cmd.createArgument().setFile(destDir);
++ }
++
++ /**
++ * Set the list of source files to process.
++ *
++ * @param src a comma separated list of source files.
++ */
++ public void setSourcefiles(String src) {
++ StringTokenizer tok = new StringTokenizer(src, ",");
++ while (tok.hasMoreTokens()) {
++ String f = tok.nextToken();
++ SourceFile sf = new SourceFile();
++ sf.setFile(getProject().resolveFile(f.trim()));
++ addSource(sf);
++ }
++ }
++
++ /**
++ * Add a single source file.
++ *
++ * @param sf the source file to be processed.
++ */
++ public void addSource(SourceFile sf) {
++ sourceFiles.addElement(sf);
++ }
++
++ /**
++ * Set the package names to be processed.
++ *
++ * @param packages a comma separated list of packages specs
++ * (may be wildcarded).
++ *
++ * @see #addPackage for wildcard information.
++ */
++ public void setPackagenames(String packages) {
++ StringTokenizer tok = new StringTokenizer(packages, ",");
++ while (tok.hasMoreTokens()) {
++ String p = tok.nextToken();
++ PackageName pn = new PackageName();
++ pn.setName(p);
++ addPackage(pn);
++ }
++ }
++
++ /**
++ * Add a single package to be processed.
++ *
++ * If the package name ends with ".*" the Javadoc task
++ * will find and process all subpackages.
++ *
++ * @param pn the package name, possibly wildcarded.
++ */
++ public void addPackage(PackageName pn) {
++ packageNames.addElement(pn);
++ }
++
++ /**
++ * Set the list of packages to be excluded.
++ *
++ * @param packages a comma separated list of packages to be excluded.
++ * This may not include wildcards.
++ */
++ public void setExcludePackageNames(String packages) {
++ StringTokenizer tok = new StringTokenizer(packages, ",");
++ while (tok.hasMoreTokens()) {
++ String p = tok.nextToken();
++ PackageName pn = new PackageName();
++ pn.setName(p);
++ addExcludePackage(pn);
++ }
++ }
++
++ /**
++ * Add a package to be excluded from the javadoc run.
++ *
++ * @param pn the name of the package (wildcards are not permitted).
++ */
++ public void addExcludePackage(PackageName pn) {
++ excludePackageNames.addElement(pn);
++ }
++
++ /**
++ * Specify the file containing the overview to be included in the generated
++ * documentation.
++ *
++ * @param f the file containing the overview.
++ */
++ public void setOverview(File f) {
++ cmd.createArgument().setValue("-overview");
++ cmd.createArgument().setFile(f);
++ }
++
++ /**
++ * Indicate whether only public classes and members are to be included in
++ * the scope processed
++ *
++ * @param b true if scope is to be public.
++ */
++ public void setPublic(boolean b) {
++ addArgIf(b, "-public");
++ }
++
++ /**
++ * Indicate whether only protected and public classes and members are to
++ * be included in the scope processed
++ *
++ * @param b true if scope is to be protected.
++ */
++ public void setProtected(boolean b) {
++ addArgIf(b, "-protected");
++ }
++
++ /**
++ * Indicate whether only package, protected and public classes and
++ * members are to be included in the scope processed
++ *
++ * @param b true if scope is to be package level.
++ */
++ public void setPackage(boolean b) {
++ addArgIf(b, "-package");
++ }
++
++ /**
++ * Indicate whether all classes and
++ * members are to be included in the scope processed
++ *
++ * @param b true if scope is to be private level.
++ */
++ public void setPrivate(boolean b) {
++ addArgIf(b, "-private");
++ }
++
++ /**
++ * Set the scope to be processed. This is an alternative to the
++ * use of the setPublic, setPrivate, etc methods. It gives better build
++ * file control over what scope is processed.
++ *
++ * @param at the scope to be processed.
++ */
++ public void setAccess(AccessType at) {
++ cmd.createArgument().setValue("-" + at.getValue());
++ }
++
++ /**
++ * Set the class that starts the doclet used in generating the
++ * documentation.
++ *
++ * @param docletName the name of the doclet class.
++ */
++ public void setDoclet(String docletName) {
++ if (doclet == null) {
++ doclet = new DocletInfo();
++ doclet.setProject(getProject());
++ }
++ doclet.setName(docletName);
++ }
++
++ /**
++ * Set the classpath used to find the doclet class.
++ *
++ * @param docletPath the doclet classpath.
++ */
++ public void setDocletPath(Path docletPath) {
++ if (doclet == null) {
++ doclet = new DocletInfo();
++ doclet.setProject(getProject());
++ }
++ doclet.setPath(docletPath);
++ }
++
++ /**
++ * Set the classpath used to find the doclet class by reference.
++ *
++ * @param r the reference to the Path instance to use as the doclet
++ * classpath.
++ */
++ public void setDocletPathRef(Reference r) {
++ if (doclet == null) {
++ doclet = new DocletInfo();
++ doclet.setProject(getProject());
++ }
++ doclet.createPath().setRefid(r);
++ }
++
++ /**
++ * Create a doclet to be used in the documentation generation.
++ *
++ * @return a new DocletInfo instance to be configured.
++ */
++ public DocletInfo createDoclet() {
++ doclet = new DocletInfo();
++ return doclet;
++ }
++
++ /**
++ * Add a taglet
++ *
++ * @param tagletInfo information about the taglet.
++ */
++ public void addTaglet(ExtensionInfo tagletInfo) {
++ tags.addElement(tagletInfo);
++ }
++
++ /**
++ * Indicate whether Javadoc should produce old style (JDK 1.1)
++ * documentation.
++ *
++ * This is not supported by JDK 1.1 and has been phased out in JDK 1.4
++ *
++ * @param b if true attempt to generate old style documentation.
++ */
++ public void setOld(boolean b) {
++ old = b;
++ }
++
++ /**
++ * Set the classpath to be used for this javadoc run.
++ *
++ * @param path an Ant Path object containing the compilation
++ * classpath.
++ */
++ public void setClasspath(Path path) {
++ if (classpath == null) {
++ classpath = path;
++ } else {
++ classpath.append(path);
++ }
++ }
++
++ /**
++ * Create a Path to be configured with the classpath to use
++ *
++ * @return a new Path instance to be configured with the classpath.
++ */
++ public Path createClasspath() {
++ if (classpath == null) {
++ classpath = new Path(getProject());
++ }
++ return classpath.createPath();
++ }
++
++ /**
++ * Adds a reference to a CLASSPATH defined elsewhere.
++ *
++ * @param r the reference to an instance defining the classpath.
++ */
++ public void setClasspathRef(Reference r) {
++ createClasspath().setRefid(r);
++ }
++
++ /**
++ * Set the boot classpath to use.
++ *
++ * @param path the boot classpath.
++ */
++ public void setBootclasspath(Path path) {
++ if (bootclasspath == null) {
++ bootclasspath = path;
++ } else {
++ bootclasspath.append(path);
++ }
++ }
++
++ /**
++ * Create a Path to be configured with the boot classpath
++ *
++ * @return a new Path instance to be configured with the boot classpath.
++ */
++ public Path createBootclasspath() {
++ if (bootclasspath == null) {
++ bootclasspath = new Path(getProject());
++ }
++ return bootclasspath.createPath();
++ }
++
++ /**
++ * Adds a reference to a CLASSPATH defined elsewhere.
++ *
++ * @param r the reference to an instance defining the bootclasspath.
++ */
++ public void setBootClasspathRef(Reference r) {
++ createBootclasspath().setRefid(r);
++ }
++
++ /**
++ * Set the location of the extensions directories.
++ *
++ * @param path the string version of the path.
++ * @deprecated Use the {@link #setExtdirs(Path)} version.
++ */
++ public void setExtdirs(String path) {
++ cmd.createArgument().setValue("-extdirs");
++ cmd.createArgument().setValue(path);
++ }
++
++ /**
++ * Set the location of the extensions directories.
++ *
++ * @param path a path containing the extension directories.
++ */
++ public void setExtdirs(Path path) {
++ cmd.createArgument().setValue("-extdirs");
++ cmd.createArgument().setPath(path);
++ }
++
++ /**
++ * Run javadoc in verbose mode
++ *
++ * @param b true if operation is to be verbose.
++ */
++ public void setVerbose(boolean b) {
++ addArgIf(b, "-verbose");
++ }
++
++ /**
++ * Set the local to use in documentation generation.
++ *
++ * @param locale the locale to use.
++ */
++ public void setLocale(String locale) {
++ // createArgument(true) is necessary to make sure, -locale
++ // is the first argument (required in 1.3+).
++ cmd.createArgument(true).setValue(locale);
++ cmd.createArgument(true).setValue("-locale");
++ }
++
++ /**
++ * Set the encoding name of the source files,
++ *
++ * @param enc the name of the encoding for the source files.
++ */
++ public void setEncoding(String enc) {
++ cmd.createArgument().setValue("-encoding");
++ cmd.createArgument().setValue(enc);
++ }
++
++ /**
++ * Include the version tag in the generated documentation.
++ *
++ * @param b true if the version tag should be included.
++ */
++ public void setVersion(boolean b) {
++ this.version = b;
++ }
++
++ /**
++ * Generate the "use" page for each package.
++ *
++ * @param b true if the use page should be generated.
++ */
++ public void setUse(boolean b) {
++ addArgIf(b, "-use");
++ }
++
++
++ /**
++ * Include the author tag in the generated documentation.
++ *
++ * @param b true if the author tag should be included.
++ */
++ public void setAuthor(boolean b) {
++ author = b;
++ }
++
++ /**
++ * Generate a split index
++ *
++ * @param b true if the index should be split into a file per letter.
++ */
++ public void setSplitindex(boolean b) {
++ addArgIf(b, "-splitindex");
++ }
++
++ /**
++ * Set the title to be placed in the HTML <title> tag of the
++ * generated documentation.
++ *
++ * @param title the window title to use.
++ */
++ public void setWindowtitle(String title) {
++ addArgIfNotEmpty("-windowtitle", title);
++ }
++
++ /**
++ * Set the title of the generated overview page.
++ *
++ * @param doctitle the Document title.
++ */
++ public void setDoctitle(String doctitle) {
++ Html h = new Html();
++ h.addText(doctitle);
++ addDoctitle(h);
++ }
++
++ /**
++ * Add a document title to use for the overview page.
++ *
++ * @param text the HTML element containing the document title.
++ */
++ public void addDoctitle(Html text) {
++ doctitle = text;
++ }
++
++ /**
++ * Set the header text to be placed at the top of each output file.
++ *
++ * @param header the header text
++ */
++ public void setHeader(String header) {
++ Html h = new Html();
++ h.addText(header);
++ addHeader(h);
++ }
++
++ /**
++ * Set the header text to be placed at the top of each output file.
++ *
++ * @param text the header text
++ */
++ public void addHeader(Html text) {
++ header = text;
++ }
++
++ /**
++ * Set the footer text to be placed at the bottom of each output file.
++ *
++ * @param footer the footer text.
++ */
++ public void setFooter(String footer) {
++ Html h = new Html();
++ h.addText(footer);
++ addFooter(h);
++ }
++
++ /**
++ * Set the footer text to be placed at the bottom of each output file.
++ *
++ * @param text the footer text.
++ */
++ public void addFooter(Html text) {
++ footer = text;
++ }
++
++ /**
++ * Set the text to be placed at the bottom of each output file.
++ *
++ * @param bottom the bottom text.
++ */
++ public void setBottom(String bottom) {
++ Html h = new Html();
++ h.addText(bottom);
++ addBottom(h);
++ }
++
++ /**
++ * Set the text to be placed at the bottom of each output file.
++ *
++ * @param text the bottom text.
++ */
++ public void addBottom(Html text) {
++ bottom = text;
++ }
++
++ /**
++ * Link to docs at "url" using package list at "url2"
++ * - separate the URLs by using a space character.
++ *
++ * @param src the offline link specification (url and package list)
++ */
++ public void setLinkoffline(String src) {
++ if (/*1.2+*/true) {
++ LinkArgument le = createLink();
++ le.setOffline(true);
++ String linkOfflineError = "The linkoffline attribute must include"
++ + " a URL and a package-list file location separated by a"
++ + " space";
++ if (src.trim().length() == 0) {
++ throw new BuildException(linkOfflineError);
++ }
++ StringTokenizer tok = new StringTokenizer(src, " ", false);
++ le.setHref(tok.nextToken());
++
++ if (!tok.hasMoreTokens()) {
++ throw new BuildException(linkOfflineError);
++ }
++ le.setPackagelistLoc(getProject().resolveFile(tok.nextToken()));
++ }
++ }
++
++ /**
++ * Group specified packages together in overview page.
++ *
++ * @param src the group packages - a command separated list of group specs,
++ * each one being a group name and package specification separated
++ * by a space.
++ */
++ public void setGroup(String src) {
++ group = src;
++ }
++
++ /**
++ * Create links to javadoc output at the given URL.
++ */
++ public void setLink(String src) {
++ createLink().setHref(src);
++ }
++
++ /**
++ * Control deprecation infromation
++ *
++ * @param b If true, do not include deprecated information.
++ */
++ public void setNodeprecated(boolean b) {
++ addArgIf(b, "-nodeprecated");
++ }
++
++ /**
++ * Control deprecated list generation
++ *
++ * @param b if true, do not generate deprecated list.
++ */
++ public void setNodeprecatedlist(boolean b) {
++ addArgIf(b, "-nodeprecatedlist");
++ }
++
++ /**
++ * Control class tree generation.
++ *
++ * @param b if true, do not generate class hierarchy.
++ */
++ public void setNotree(boolean b) {
++ addArgIf(b, "-notree");
++ }
++
++ /**
++ * Control generation of index.
++ *
++ * @param b if true, do not generate index.
++ */
++ public void setNoindex(boolean b) {
++ addArgIf(b, "-noindex");
++ }
++
++ /**
++ * Control generation of help link.
++ *
++ * @param b if true, do not generate help link
++ */
++ public void setNohelp(boolean b) {
++ addArgIf(b, "-nohelp");
++ }
++
++ /**
++ * Control generation of the navigation bar.
++ *
++ * @param b if true, do not generate navigation bar.
++ */
++ public void setNonavbar(boolean b) {
++ addArgIf(b, "-nonavbar");
++ }
++
++ /**
++ * Control warnings about serial tag.
++ *
++ * @param b if true, generate warning about the serial tag.
++ */
++ public void setSerialwarn(boolean b) {
++ addArgIf(b, "-serialwarn");
++ }
++
++ /**
++ * Specifies the CSS stylesheet file to use.
++ *
++ * @param f the file with the CSS to use.
++ */
++ public void setStylesheetfile(File f) {
++ cmd.createArgument().setValue("-stylesheetfile");
++ cmd.createArgument().setFile(f);
++ }
++
++ /**
++ * Specifies the HTML help file to use.
++ *
++ * @param f the file containing help content.
++ */
++ public void setHelpfile(File f) {
++ cmd.createArgument().setValue("-helpfile");
++ cmd.createArgument().setFile(f);
++ }
++
++ /**
++ * Output file encoding name.
++ *
++ * @param enc name of the encoding to use.
++ */
++ public void setDocencoding(String enc) {
++ cmd.createArgument().setValue("-docencoding");
++ cmd.createArgument().setValue(enc);
++ }
++
++ /**
++ * The name of a file containing the packages to process.
++ *
++ * @param src the file containing the package list.
++ */
++ public void setPackageList(String src) {
++ packageList = src;
++ }
++
++ /**
++ * Create link to javadoc output at the given URL.
++ *
++ * @return link argument to configure
++ */
++ public LinkArgument createLink() {
++ LinkArgument la = new LinkArgument();
++ links.addElement(la);
++ return la;
++ }
++
++ /**
++ * Represents a link triplet (href, whether link is offline, location of the
++ * package list if off line)
++ */
++ public class LinkArgument {
++ private String href;
++ private boolean offline = false;
++ private File packagelistLoc;
++ private boolean resolveLink = false;
++
++ public LinkArgument() {
++ }
++
++ public void setHref(String hr) {
++ href = hr;
++ }
++
++ public String getHref() {
++ return href;
++ }
++
++ public void setPackagelistLoc(File src) {
++ packagelistLoc = src;
++ }
++
++ public File getPackagelistLoc() {
++ return packagelistLoc;
++ }
++
++ public void setOffline(boolean offline) {
++ this.offline = offline;
++ }
++
++ public boolean isLinkOffline() {
++ return offline;
++ }
++
++ /**
++ * Sets whether Ant should resolve the link attribute relative
++ * to the current basedir.
++ * @param resolve a <code>boolean</code> value
++ */
++ public void setResolveLink(boolean resolve) {
++ this.resolveLink = resolve;
++ }
++
++ /**
++ * should Ant resolve the link attribute relative to the
++ * current basedir?
++ */
++ public boolean shouldResolveLink() {
++ return resolveLink;
++ }
++
++ }
++
++ /**
++ * Creates and adds a -tag argument. This is used to specify
++ * custom tags. This argument is only available for JavaDoc 1.4,
++ * and will generate a verbose message (and then be ignored)
++ * when run on Java versions below 1.4.
++ */
++ public TagArgument createTag() {
++ TagArgument ta = new TagArgument();
++ tags.addElement (ta);
++ return ta;
++ }
++
++ /**
++ * Scope element verbose names. (Defined here as fields
++ * cannot be static in inner classes.) The first letter
++ * from each element is used to build up the scope string.
++ */
++ static final String[] SCOPE_ELEMENTS = {
++ "overview", "packages", "types", "constructors",
++ "methods", "fields"
++ };
++
++ /**
++ * Class representing a -tag argument.
++ */
++ public class TagArgument extends FileSet {
++ /** Name of the tag. */
++ private String name = null;
++ /** Description of the tag to place in the JavaDocs. */
++ private String description = null;
++ /** Whether or not the tag is enabled. */
++ private boolean enabled = true;
++ /**
++ * Scope string of the tag. This will form the middle
++ * argument of the -tag parameter when the tag is enabled
++ * (with an X prepended for and is parsed from human-readable form.
++ */
++ private String scope = "a";
++
++ /** Sole constructor. */
++ public TagArgument () {
++ }
++
++ /**
++ * Sets the name of the tag.
++ *
++ * @param name The name of the tag.
++ * Must not be <code>null</code> or empty.
++ */
++ public void setName (String name) {
++ this.name = name;
++ }
++
++ /**
++ * Sets the description of the tag. This is what appears in
++ * the JavaDoc.
++ *
++ * @param description The description of the tag.
++ * Must not be <code>null</code> or empty.
++ */
++ public void setDescription (String description) {
++ this.description = description;
++ }
++
++ /**
++ * Sets the scope of the tag. This is in comma-separated
++ * form, with each element being one of "all" (the default),
++ * "overview", "packages", "types", "constructors", "methods",
++ * "fields". The elements are treated in a case-insensitive
++ * manner.
++ *
++ * @param verboseScope The scope of the tag.
++ * Must not be <code>null</code>,
++ * should not be empty.
++ *
++ * @exception BuildException if all is specified along with
++ * other elements, if any elements are repeated, if no
++ * elements are specified, or if any unrecognised elements are
++ * specified.
++ */
++ public void setScope (String verboseScope) throws BuildException {
++ verboseScope = verboseScope.toLowerCase(Locale.US);
++
++ boolean[] elements = new boolean[SCOPE_ELEMENTS.length];
++
++ boolean gotAll = false;
++ boolean gotNotAll = false;
++
++ // Go through the tokens one at a time, updating the
++ // elements array and issuing warnings where appropriate.
++ StringTokenizer tok = new StringTokenizer (verboseScope, ",");
++ while (tok.hasMoreTokens()) {
++ String next = tok.nextToken().trim();
++ if (next.equals("all")) {
++ if (gotAll) {
++ getProject().log ("Repeated tag scope element: all",
++ Project.MSG_VERBOSE);
++ }
++ gotAll = true;
++ } else {
++ int i;
++ for (i = 0; i < SCOPE_ELEMENTS.length; i++) {
++ if (next.equals (SCOPE_ELEMENTS[i])) {
++ break;
++ }
++ }
++ if (i == SCOPE_ELEMENTS.length) {
++ throw new BuildException ("Unrecognised scope element: "
++ + next);
++ } else {
++ if (elements[i]) {
++ getProject().log ("Repeated tag scope element: "
++ + next, Project.MSG_VERBOSE);
++ }
++ elements[i] = true;
++ gotNotAll = true;
++ }
++ }
++ }
++
++ if (gotNotAll && gotAll) {
++ throw new BuildException ("Mixture of \"all\" and other scope "
++ + "elements in tag parameter.");
++ }
++ if (!gotNotAll && !gotAll) {
++ throw new BuildException ("No scope elements specified in tag "
++ + "parameter.");
++ }
++ if (gotAll) {
++ this.scope = "a";
++ } else {
++ StringBuffer buff = new StringBuffer (elements.length);
++ for (int i = 0; i < elements.length; i++) {
++ if (elements[i]) {
++ buff.append (SCOPE_ELEMENTS[i].charAt(0));
++ }
++ }
++ this.scope = buff.toString();
++ }
++ }
++
++ /**
++ * Sets whether or not the tag is enabled.
++ *
++ * @param enabled Whether or not this tag is enabled.
++ */
++ public void setEnabled (boolean enabled) {
++ this.enabled = enabled;
++ }
++
++ /**
++ * Returns the -tag parameter this argument represented.
++ *
++ * @exception BuildException if either the name or description
++ * is <code>null</code> or empty.
++ */
++ public String getParameter () throws BuildException {
++ if (name == null || name.equals("")) {
++ throw new BuildException ("No name specified for custom tag.");
++ }
++ if (description != null) {
++ return name + ":" + (enabled ? "" : "X")
++ + scope + ":" + description;
++ } else {
++ return name;
++ }
++ }
++ }
++
++ /**
++ * Separates packages on the overview page into whatever
++ * groups you specify, one group per table.
++ */
++ public GroupArgument createGroup() {
++ GroupArgument ga = new GroupArgument();
++ groups.addElement(ga);
++ return ga;
++ }
++
++ public class GroupArgument {
++ private Html title;
++ private Vector packages = new Vector();
++
++ public GroupArgument() {
++ }
++
++ public void setTitle(String src) {
++ Html h = new Html();
++ h.addText(src);
++ addTitle(h);
++ }
++ public void addTitle(Html text) {
++ title = text;
++ }
++
++ public String getTitle() {
++ return title != null ? title.getText() : null;
++ }
++
++ public void setPackages(String src) {
++ StringTokenizer tok = new StringTokenizer(src, ",");
++ while (tok.hasMoreTokens()) {
++ String p = tok.nextToken();
++ PackageName pn = new PackageName();
++ pn.setName(p);
++ addPackage(pn);
++ }
++ }
++ public void addPackage(PackageName pn) {
++ packages.addElement(pn);
++ }
++
++ public String getPackages() {
++ StringBuffer p = new StringBuffer();
++ for (int i = 0; i < packages.size(); i++) {
++ if (i > 0) {
++ p.append(":");
++ }
++ p.append(packages.elementAt(i).toString());
++ }
++ return p.toString();
++ }
++ }
++
++ /**
++ * Charset for cross-platform viewing of generated documentation.
++ */
++ public void setCharset(String src) {
++ this.addArgIfNotEmpty("-charset", src);
++ }
++
++ /**
++ * Should the build process fail if javadoc fails (as indicated by
++ * a non zero return code)?
++ *
++ * <p>Default is false.</p>
++ */
++ public void setFailonerror(boolean b) {
++ failOnError = b;
++ }
++
++ /**
++ * Enables the -source switch, will be ignored if javadoc is not
++ * the 1.4 version.
++ *
++ * @since Ant 1.5
++ */
++ public void setSource(String source) {
++ this.source = source;
++ }
++
++ /**
++ * Sets the actual executable command to invoke, instead of the binary
++ * <code>javadoc</code> found in Ant's JDK.
++ * @since Ant 1.6.3
++ */
++ public void setExecutable(String executable) {
++ this.executable = executable;
++ }
++
++ /**
++ * Adds a packageset.
++ *
++ * <p>All included directories will be translated into package
++ * names be converting the directory separator into dots.</p>
++ *
++ * @since 1.5
++ */
++ public void addPackageset(DirSet packageSet) {
++ packageSets.addElement(packageSet);
++ }
++
++ /**
++ * Adds a fileset.
++ *
++ * <p>All included files will be added as sourcefiles. The task
++ * will automatically add
++ * <code>includes="**/*.java"</code> to the
++ * fileset.</p>
++ *
++ * @since 1.5
++ */
++ public void addFileset(FileSet fs) {
++ fileSets.addElement(fs);
++ }
++
++ /**
++ * Enables the -linksource switch, will be ignored if javadoc is not
++ * the 1.4 version. Default is false
++ *
++ * @since Ant 1.6
++ */
++ public void setLinksource(boolean b) {
++ this.linksource = b;
++ }
++
++ /**
++ * Enables the -linksource switch, will be ignored if javadoc is not
++ * the 1.4 version. Default is false
++ *
++ * @since Ant 1.6
++ */
++ public void setBreakiterator(boolean b) {
++ this.breakiterator = b;
++ }
++
++ /**
++ * Enables the -noqualifier switch, will be ignored if javadoc is not
++ * the 1.4 version.
++ *
++ * @since Ant 1.6
++ */
++ public void setNoqualifier(String noqualifier) {
++ this.noqualifier = noqualifier;
++ }
++
++ /**
++ * If set to true, Ant will also accept packages that only hold
++ * package.html files but no Java sources.
++ * @since Ant 1.6.3
++ */
++ public void setIncludeNoSourcePackages(boolean b) {
++ this.includeNoSourcePackages = b;
++ }
++
++ public void execute() throws BuildException {
++
++ // Whether *this VM* is 1.4+ (but also check executable != null).
++ boolean javadoc4 =
++ !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) &&
++ !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3);
++
++ Vector packagesToDoc = new Vector();
++ Path sourceDirs = new Path(getProject());
++
++ if (packageList != null && sourcePath == null) {
++ String msg = "sourcePath attribute must be set when "
++ + "specifying packagelist.";
++ throw new BuildException(msg);
++ }
++
++ if (sourcePath != null) {
++ sourceDirs.addExisting(sourcePath);
++ }
++
++ parsePackages(packagesToDoc, sourceDirs);
++
++ if (packagesToDoc.size() != 0 && sourceDirs.size() == 0) {
++ String msg = "sourcePath attribute must be set when "
++ + "specifying package names.";
++ throw new BuildException(msg);
++ }
++
++ Vector sourceFilesToDoc = (Vector) sourceFiles.clone();
++ addFileSets(sourceFilesToDoc);
++
++ if (packageList == null && packagesToDoc.size() == 0
++ && sourceFilesToDoc.size() == 0) {
++ throw new BuildException("No source files and no packages have "
++ + "been specified.");
++ }
++
++ log("Generating Javadoc with Gjdoc", Project.MSG_INFO);
++
++ Commandline toExecute = (Commandline) cmd.clone();
++
++ if (executable != null)
++ toExecute.setExecutable(executable);
++ else
++ toExecute.setExecutable("/usr/bin/gjdoc");
++
++
++ // ------------------------------------------ general javadoc arguments
++ if (doctitle != null) {
++ toExecute.createArgument().setValue("-doctitle");
++ toExecute.createArgument().setValue(expand(doctitle.getText()));
++ }
++ if (header != null) {
++ toExecute.createArgument().setValue("-header");
++ toExecute.createArgument().setValue(expand(header.getText()));
++ }
++ if (footer != null) {
++ toExecute.createArgument().setValue("-footer");
++ toExecute.createArgument().setValue(expand(footer.getText()));
++ }
++ if (bottom != null) {
++ toExecute.createArgument().setValue("-bottom");
++ toExecute.createArgument().setValue(expand(bottom.getText()));
++ }
++
++ if (classpath == null) {
++ classpath = (new Path(getProject())).concatSystemClasspath("last");
++ } else {
++ classpath = classpath.concatSystemClasspath("ignore");
++ }
++
++ if (/*1.2+*/true) {
++ if (classpath.size() > 0) {
++ toExecute.createArgument().setValue("-classpath");
++ toExecute.createArgument().setPath(classpath);
++ }
++ if (sourceDirs.size() > 0) {
++ toExecute.createArgument().setValue("-sourcepath");
++ toExecute.createArgument().setPath(sourceDirs);
++ }
++ }
++
++ if (version && doclet == null) {
++ toExecute.createArgument().setValue("-version");
++ }
++ if (author && doclet == null) {
++ toExecute.createArgument().setValue("-author");
++ }
++
++ if (doclet == null) {
++ if (destDir == null) {
++ String msg = "destDir attribute must be set!";
++ throw new BuildException(msg);
++ }
++ }
++
++ // ---------------------------- javadoc2 arguments for default doclet
++
++ if (/*1.2+*/true) {
++ if (doclet != null) {
++ if (doclet.getName() == null) {
++ throw new BuildException("The doclet name must be "
++ + "specified.", getLocation());
++ } else {
++ toExecute.createArgument().setValue("-doclet");
++ toExecute.createArgument().setValue(doclet.getName());
++ if (doclet.getPath() != null) {
++ Path docletPath
++ = doclet.getPath().concatSystemClasspath("ignore");
++ if (docletPath.size() != 0) {
++ toExecute.createArgument().setValue("-docletpath");
++ toExecute.createArgument().setPath(docletPath);
++ }
++ }
++ for (Enumeration e = doclet.getParams();
++ e.hasMoreElements();) {
++ DocletParam param = (DocletParam) e.nextElement();
++ if (param.getName() == null) {
++ throw new BuildException("Doclet parameters must "
++ + "have a name");
++ }
++
++ toExecute.createArgument().setValue(param.getName());
++ if (param.getValue() != null) {
++ toExecute.createArgument()
++ .setValue(param.getValue());
++ }
++ }
++ }
++ }
++ if (bootclasspath != null && bootclasspath.size() > 0) {
++ toExecute.createArgument().setValue("-bootclasspath");
++ toExecute.createArgument().setPath(bootclasspath);
++ }
++
++ // add the links arguments
++ if (links.size() != 0) {
++ for (Enumeration e = links.elements(); e.hasMoreElements();) {
++ LinkArgument la = (LinkArgument) e.nextElement();
++
++ if (la.getHref() == null || la.getHref().length() == 0) {
++ log("No href was given for the link - skipping",
++ Project.MSG_VERBOSE);
++ continue;
++ }
++ String link = null;
++ if (la.shouldResolveLink()) {
++ File hrefAsFile =
++ getProject().resolveFile(la.getHref());
++ if (hrefAsFile.exists()) {
++ try {
++ link = fileUtils.getFileURL(hrefAsFile)
++ .toExternalForm();
++ } catch (MalformedURLException ex) {
++ // should be impossible
++ log("Warning: link location was invalid "
++ + hrefAsFile, Project.MSG_WARN);
++ }
++ }
++ }
++ if (link == null) {
++ // is the href a valid URL
++ try {
++ URL base = new URL("file://.");
++ new URL(base, la.getHref());
++ link = la.getHref();
++ } catch (MalformedURLException mue) {
++ // ok - just skip
++ log("Link href \"" + la.getHref()
++ + "\" is not a valid url - skipping link",
++ Project.MSG_WARN);
++ continue;
++ }
++ }
++
++ if (la.isLinkOffline()) {
++ File packageListLocation = la.getPackagelistLoc();
++ if (packageListLocation == null) {
++ throw new BuildException("The package list "
++ + " location for link " + la.getHref()
++ + " must be provided because the link is "
++ + "offline");
++ }
++ File packageListFile =
++ new File(packageListLocation, "package-list");
++ if (packageListFile.exists()) {
++ try {
++ String packageListURL =
++ fileUtils.getFileURL(packageListLocation)
++ .toExternalForm();
++ toExecute.createArgument()
++ .setValue("-linkoffline");
++ toExecute.createArgument()
++ .setValue(link);
++ toExecute.createArgument()
++ .setValue(packageListURL);
++ } catch (MalformedURLException ex) {
++ log("Warning: Package list location was "
++ + "invalid " + packageListLocation,
++ Project.MSG_WARN);
++ }
++ } else {
++ log("Warning: No package list was found at "
++ + packageListLocation, Project.MSG_VERBOSE);
++ }
++ } else {
++ toExecute.createArgument().setValue("-link");
++ toExecute.createArgument().setValue(link);
++ }
++ }
++ }
++
++ // add the single group arguments
++ // Javadoc 1.2 rules:
++ // Multiple -group args allowed.
++ // Each arg includes 3 strings: -group [name] [packagelist].
++ // Elements in [packagelist] are colon-delimited.
++ // An element in [packagelist] may end with the * wildcard.
++
++ // Ant javadoc task rules for group attribute:
++ // Args are comma-delimited.
++ // Each arg is 2 space-delimited strings.
++ // E.g., group="XSLT_Packages org.apache.xalan.xslt*,
++ // XPath_Packages org.apache.xalan.xpath*"
++ if (group != null) {
++ StringTokenizer tok = new StringTokenizer(group, ",", false);
++ while (tok.hasMoreTokens()) {
++ String grp = tok.nextToken().trim();
++ int space = grp.indexOf(" ");
++ if (space > 0) {
++ String name = grp.substring(0, space);
++ String pkgList = grp.substring(space + 1);
++ toExecute.createArgument().setValue("-group");
++ toExecute.createArgument().setValue(name);
++ toExecute.createArgument().setValue(pkgList);
++ }
++ }
++ }
++
++ // add the group arguments
++ if (groups.size() != 0) {
++ for (Enumeration e = groups.elements(); e.hasMoreElements();) {
++ GroupArgument ga = (GroupArgument) e.nextElement();
++ String title = ga.getTitle();
++ String packages = ga.getPackages();
++ if (title == null || packages == null) {
++ throw new BuildException("The title and packages must "
++ + "be specified for group "
++ + "elements.");
++ }
++ toExecute.createArgument().setValue("-group");
++ toExecute.createArgument().setValue(expand(title));
++ toExecute.createArgument().setValue(packages);
++ }
++ }
++
++ // JavaDoc 1.4 parameters
++ if (javadoc4 || executable != null) {
++ for (Enumeration e = tags.elements(); e.hasMoreElements();) {
++ Object element = e.nextElement();
++ if (element instanceof TagArgument) {
++ TagArgument ta = (TagArgument) element;
++ File tagDir = ta.getDir(getProject());
++ if (tagDir == null) {
++ // The tag element is not used as a fileset,
++ // but specifies the tag directly.
++ toExecute.createArgument().setValue ("-tag");
++ toExecute.createArgument().setValue (ta.getParameter());
++ } else {
++ // The tag element is used as a fileset. Parse all the files and
++ // create -tag arguments.
++ DirectoryScanner tagDefScanner = ta.getDirectoryScanner(getProject());
++ String[] files = tagDefScanner.getIncludedFiles();
++ for (int i = 0; i < files.length; i++) {
++ File tagDefFile = new File(tagDir, files[i]);
++ try {
++ BufferedReader in
++ = new BufferedReader(new FileReader(tagDefFile));
++ String line = null;
++ while ((line = in.readLine()) != null) {
++ toExecute.createArgument().setValue ("-tag");
++ toExecute.createArgument().setValue (line);
++ }
++ in.close();
++ } catch (IOException ioe) {
++ throw new BuildException("Couldn't read "
++ + " tag file from "
++ + tagDefFile.getAbsolutePath(), ioe);
++ }
++ }
++ }
++ } else {
++ ExtensionInfo tagletInfo = (ExtensionInfo) element;
++ toExecute.createArgument().setValue("-taglet");
++ toExecute.createArgument().setValue(tagletInfo
++ .getName());
++ if (tagletInfo.getPath() != null) {
++ Path tagletPath = tagletInfo.getPath()
++ .concatSystemClasspath("ignore");
++ if (tagletPath.size() != 0) {
++ toExecute.createArgument()
++ .setValue("-tagletpath");
++ toExecute.createArgument().setPath(tagletPath);
++ }
++ }
++ }
++ }
++
++ if (source != null) {
++ toExecute.createArgument().setValue("-source");
++ toExecute.createArgument().setValue(source);
++ }
++
++ if (linksource && doclet == null) {
++ toExecute.createArgument().setValue("-linksource");
++ }
++ if (breakiterator && doclet == null) {
++ toExecute.createArgument().setValue("-breakiterator");
++ }
++ if (noqualifier != null && doclet == null) {
++ toExecute.createArgument().setValue("-noqualifier");
++ toExecute.createArgument().setValue(noqualifier);
++ }
++ } else {
++ // Not 1.4+.
++ if (!tags.isEmpty()) {
++ log("-tag and -taglet options not supported on Javadoc < 1.4",
++ Project.MSG_VERBOSE);
++ }
++ if (source != null) {
++ log("-source option not supported on JavaDoc < 1.4",
++ Project.MSG_VERBOSE);
++ }
++ if (linksource) {
++ log("-linksource option not supported on JavaDoc < 1.4",
++ Project.MSG_VERBOSE);
++ }
++ if (breakiterator) {
++ log("-breakiterator option not supported on JavaDoc < 1.4",
++ Project.MSG_VERBOSE);
++ }
++ if (noqualifier != null) {
++ log("-noqualifier option not supported on JavaDoc < 1.4",
++ Project.MSG_VERBOSE);
++ }
++ }
++ // Javadoc 1.2/1.3 parameters:
++ if (!javadoc4 || executable != null) {
++ if (old) {
++ toExecute.createArgument().setValue("-1.1");
++ }
++ } else {
++ if (old) {
++ log("Javadoc 1.4 doesn't support the -1.1 switch anymore",
++ Project.MSG_WARN);
++ }
++ }
++
++ }
++
++ File tmpList = null;
++ PrintWriter srcListWriter = null;
++ try {
++
++ /**
++ * Write sourcefiles and package names to a temporary file
++ * if requested.
++ */
++ if (useExternalFile) {
++ if (tmpList == null) {
++ tmpList = fileUtils.createTempFile("javadoc", "", null);
++ tmpList.deleteOnExit();
++ toExecute.createArgument()
++ .setValue("@" + tmpList.getAbsolutePath());
++ }
++ srcListWriter = new PrintWriter(
++ new FileWriter(tmpList.getAbsolutePath(),
++ true));
++ }
++
++ Enumeration e = packagesToDoc.elements();
++ while (e.hasMoreElements()) {
++ String packageName = (String) e.nextElement();
++ if (useExternalFile) {
++ srcListWriter.println(packageName);
++ } else {
++ toExecute.createArgument().setValue(packageName);
++ }
++ }
++
++ e = sourceFilesToDoc.elements();
++ while (e.hasMoreElements()) {
++ SourceFile sf = (SourceFile) e.nextElement();
++ String sourceFileName = sf.getFile().getAbsolutePath();
++ if (useExternalFile) {
++ if (javadoc4 && sourceFileName.indexOf(" ") > -1) {
++ srcListWriter.println("\"" + sourceFileName + "\"");
++ } else {
++ srcListWriter.println(sourceFileName);
++ }
++ } else {
++ toExecute.createArgument().setValue(sourceFileName);
++ }
++ }
++
++ } catch (IOException e) {
++ tmpList.delete();
++ throw new BuildException("Error creating temporary file",
++ e, getLocation());
++ } finally {
++ if (srcListWriter != null) {
++ srcListWriter.close();
++ }
++ }
++
++ if (packageList != null) {
++ toExecute.createArgument().setValue("@" + packageList);
++ }
++ log(toExecute.describeCommand(), Project.MSG_VERBOSE);
++
++ log("Javadoc execution through Gjdoc", Project.MSG_INFO);
++
++ JavadocOutputStream out = new JavadocOutputStream(Project.MSG_INFO);
++ JavadocOutputStream err = new JavadocOutputStream(Project.MSG_WARN);
++
++ Execute exe = new Execute(new PumpStreamHandler(out, err));
++ exe.setAntRun(getProject());
++
++ String[] env = exe.getEnvironment();
++ String javahome = System.getProperty("java.home");
++ // setting the JAVA_HOME variable in the process execution environment
++ // needed as otherwise gjdoc will go to kaffe by default
++ log("Setting JAVA_HOME environment variable for the gjdoc executable process to: "+ javahome, Project.MSG_VERBOSE);
++ if(env != null) {
++ for(int i=0; i < env.length; i++) {
++ if( env[i].startsWith("JAVA_HOME") )
++ env[i] = "JAVA_HOME=" + javahome;
++ }
++ }
++ else
++ exe.setEnvironment(new String[] {"JAVA_HOME=" + javahome });
++
++ /*
++ * No reason to change the working directory as all filenames and
++ * path components have been resolved already.
++ *
++ * Avoid problems with command line length in some environments.
++ */
++ exe.setWorkingDirectory(null);
++ try {
++ exe.setCommandline(toExecute.getCommandline());
++ int ret = exe.execute();
++ if (ret != 0 && failOnError) {
++ throw new BuildException("Gjdoc returned " + ret, getLocation());
++ }
++ } catch (IOException e) {
++ throw new BuildException("Gjdoc failed: " + e, e, getLocation());
++ } finally {
++ if (tmpList != null) {
++ tmpList.delete();
++ tmpList = null;
++ }
++
++ out.logFlush();
++ err.logFlush();
++ try {
++ out.close();
++ err.close();
++ } catch (IOException e) {
++ // ignore
++ }
++ }
++ }
++
++ /**
++ * Add the files matched by the nested filesets to the Vector as
++ * SourceFile instances.
++ *
++ * @since 1.5
++ */
++ private void addFileSets(Vector sf) {
++ Enumeration e = fileSets.elements();
++ while (e.hasMoreElements()) {
++ FileSet fs = (FileSet) e.nextElement();
++ if (!fs.hasPatterns() && !fs.hasSelectors()) {
++ fs = (FileSet) fs.clone();
++ fs.createInclude().setName("**/*.java");
++ if (includeNoSourcePackages) {
++ fs.createInclude().setName("**/package.html");
++ }
++ }
++ File baseDir = fs.getDir(getProject());
++ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
++ String[] files = ds.getIncludedFiles();
++ for (int i = 0; i < files.length; i++) {
++ sf.addElement(new SourceFile(new File(baseDir, files[i])));
++ }
++ }
++ }
++
++ /**
++ * Add the directories matched by the nested dirsets to the Vector
++ * and the base directories of the dirsets to the Path. It also
++ * handles the packages and excludepackages attributes and
++ * elements.
++ *
++ * @since 1.5
++ */
++ private void parsePackages(Vector pn, Path sp) {
++ Vector addedPackages = new Vector();
++ Vector dirSets = (Vector) packageSets.clone();
++
++ // for each sourcePath entry, add a directoryset with includes
++ // taken from packagenames attribute and nested package
++ // elements and excludes taken from excludepackages attribute
++ // and nested excludepackage elements
++ if (sourcePath != null && packageNames.size() > 0) {
++ PatternSet ps = new PatternSet();
++ Enumeration e = packageNames.elements();
++ while (e.hasMoreElements()) {
++ PackageName p = (PackageName) e.nextElement();
++ String pkg = p.getName().replace('.', '/');
++ if (pkg.endsWith("*")) {
++ pkg += "*";
++ }
++ ps.createInclude().setName(pkg);
++ }
++
++ e = excludePackageNames.elements();
++ while (e.hasMoreElements()) {
++ PackageName p = (PackageName) e.nextElement();
++ String pkg = p.getName().replace('.', '/');
++ if (pkg.endsWith("*")) {
++ pkg += "*";
++ }
++ ps.createExclude().setName(pkg);
++ }
++
++
++ String[] pathElements = sourcePath.list();
++ for (int i = 0; i < pathElements.length; i++) {
++ DirSet ds = new DirSet();
++ ds.setDefaultexcludes(useDefaultExcludes);
++ ds.setDir(new File(pathElements[i]));
++ ds.createPatternSet().addConfiguredPatternset(ps);
++ dirSets.addElement(ds);
++ }
++ }
++
++ Enumeration e = dirSets.elements();
++ while (e.hasMoreElements()) {
++ DirSet ds = (DirSet) e.nextElement();
++ File baseDir = ds.getDir(getProject());
++ log("scanning " + baseDir + " for packages.", Project.MSG_DEBUG);
++ DirectoryScanner dsc = ds.getDirectoryScanner(getProject());
++ String[] dirs = dsc.getIncludedDirectories();
++ boolean containsPackages = false;
++ for (int i = 0; i < dirs.length; i++) {
++ // are there any java files in this directory?
++ File pd = new File(baseDir, dirs[i]);
++ String[] files = pd.list(new FilenameFilter () {
++ public boolean accept(File dir1, String name) {
++ return name.endsWith(".java")
++ || (includeNoSourcePackages
++ && name.equals("package.html"));
++ }
++ });
++
++ if (files.length > 0) {
++ containsPackages = true;
++ String packageName =
++ dirs[i].replace(File.separatorChar, '.');
++ if (!addedPackages.contains(packageName)) {
++ addedPackages.addElement(packageName);
++ pn.addElement(packageName);
++ }
++ }
++ }
++ if (containsPackages) {
++ // We don't need to care for duplicates here,
++ // Path.list does it for us.
++ sp.createPathElement().setLocation(baseDir);
++ } else {
++ log(baseDir + " doesn\'t contain any packages, dropping it.",
++ Project.MSG_VERBOSE);
++ }
++ }
++ }
++
++ private class JavadocOutputStream extends LogOutputStream {
++ JavadocOutputStream(int level) {
++ super(Gjdoc.this, level);
++ }
++
++ //
++ // Override the logging of output in order to filter out Generating
++ // messages. Generating messages are set to a priority of VERBOSE
++ // unless they appear after what could be an informational message.
++ //
++ private String queuedLine = null;
++ protected void processLine(String line, int messageLevel) {
++ if (messageLevel == Project.MSG_INFO
++ && line.startsWith("Generating ")) {
++ if (queuedLine != null) {
++ super.processLine(queuedLine, Project.MSG_VERBOSE);
++ }
++ queuedLine = line;
++ } else {
++ if (queuedLine != null) {
++ if (line.startsWith("Building ")) {
++ super.processLine(queuedLine, Project.MSG_VERBOSE);
++ } else {
++ super.processLine(queuedLine, Project.MSG_INFO);
++ }
++ queuedLine = null;
++ }
++ super.processLine(line, messageLevel);
++ }
++ }
++
++
++ protected void logFlush() {
++ if (queuedLine != null) {
++ super.processLine(queuedLine, Project.MSG_VERBOSE);
++ queuedLine = null;
++ }
++ }
++ }
++
++ /**
++ * Convenience method to expand properties.
++ */
++ protected String expand(String content) {
++ return getProject().replaceProperties(content);
++ }
++
++}
Added: trunk/ant/debian/patches/javadoc_maxmemory.patch
===================================================================
--- trunk/ant/debian/patches/javadoc_maxmemory.patch (rev 0)
+++ trunk/ant/debian/patches/javadoc_maxmemory.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,18 @@
+--- a/build.xml
++++ b/build.xml
+@@ -1392,6 +1392,7 @@
+ version="true"
+ locale="en"
+ windowtitle="${Name} API"
++ maxmemory="256m"
+ doctitle="${Name}"
+ failonerror="true"
+ verbose="${javadoc.verbose}">
+@@ -1426,6 +1427,7 @@
+ version="true"
+ locale="en"
+ windowtitle="${Name} Test Utilities"
++ maxmemory="256m"
+ doctitle="${Name}">
+
+ <!-- hide some meta information for javadoc -->
Added: trunk/ant/debian/patches/no_test-jars.patch
===================================================================
--- trunk/ant/debian/patches/no_test-jars.patch (rev 0)
+++ trunk/ant/debian/patches/no_test-jars.patch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,11 @@
+--- a/build.xml
++++ b/build.xml
+@@ -830,7 +830,7 @@
+ ===================================================================
+ -->
+ <target name="dist-lite"
+- depends="jars,test-jar"
++ depends="jars"
+ description="--> creates a minimum distribution to run Apache Ant">
+
+ <mkdir dir="${dist.dir}"/>
Added: trunk/ant/debian/patches/series
===================================================================
--- trunk/ant/debian/patches/series (rev 0)
+++ trunk/ant/debian/patches/series 2010-02-16 21:19:57 UTC (rev 11606)
@@ -0,0 +1,8 @@
+ant_native2ascii.patch
+ant-source-target-version.patch
+no_test-jars.patch
+ant_add_xerces.patch
+javadoc_maxmemory.patch
+gjdoc_task.patch
+ant_home_path.patch
+build-path.patch
Modified: trunk/ant/debian/rules
===================================================================
--- trunk/ant/debian/rules 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/rules 2010-02-16 21:19:57 UTC (rev 11606)
@@ -4,7 +4,7 @@
#export DH_VERBOSE=1
include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/gcj/debian_defaults
ifneq (,$(filter $(DEB_HOST_ARCH), $(gcj_native_archs)))
@@ -29,7 +29,7 @@
PACKAGE := $(DEB_SOURCE_PACKAGE)
VERSION := $(DEB_UPSTREAM_VERSION)
JAR_PATH := /usr/share/java
-CLASSPATH := ${JAR_PATH}/activation.jar:${JAR_PATH}/antlr.jar:${JAR_PATH}/bcel.jar:${JAR_PATH}/bsf.jar:${JAR_PATH}/commons-logging.jar:${JAR_PATH}/gnumail.jar:${JAR_PATH}/inetlib.jar:${JAR_PATH}/jdepend.jar:${JAR_PATH}/junit.jar:${JAR_PATH}/log4j-1.2.jar:${JAR_PATH}/oro.jar:${JAR_PATH}/regexp.jar:${JAR_PATH}/xalan2.jar:${JAR_PATH}/xml-commons-resolver-1.1.jar:${JAR_PATH}/commons-net.jar:${JAR_PATH}/jsch.jar
+CLASSPATH := ${JAR_PATH}/activation.jar:${JAR_PATH}/antlr.jar:${JAR_PATH}/bcel.jar:${JAR_PATH}/bsf.jar:${JAR_PATH}/commons-logging.jar:${JAR_PATH}/gnumail.jar:${JAR_PATH}/inetlib.jar:${JAR_PATH}/jdepend.jar:${JAR_PATH}/junit.jar:${JAR_PATH}/log4j-1.2.jar:${JAR_PATH}/oro.jar:${JAR_PATH}/regexp.jar:${JAR_PATH}/xalan2.jar:${JAR_PATH}/xml-commons-resolver-1.1.jar:${JAR_PATH}/commons-net.jar:${JAR_PATH}/jsch.jar:${JAR_PATH}/stylebook.jar
build-ant: stamp-build-ant
stamp-build-ant:
@@ -41,7 +41,7 @@
# remove -SNAPSHOT from the versions in the Maven poms
perl -p -i -e 's/-SNAPSHOT//g' `find src/etc/poms/ -name pom.xml`
# the rest
- /bin/sh bootstrap/bin/ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 -lib ${CLASSPATH} -propertyfile debian/ant.properties jars javadocs
+ /bin/sh bootstrap/bin/ant -Dant.build.javac.source=1.4 -Dant.build.javac.target=1.4 -Dbuild.classpath=${CLASSPATH} -propertyfile debian/ant.properties jars javadocs
ln -sf /usr/share/java/xml-apis.jar $(DEB_BUILDDIR)/lib/xml-apis.jar
ln -sf /usr/share/java/xercesImpl.jar $(DEB_BUILDDIR)/lib/xercesImpl.jar
touch stamp-build-ant
@@ -70,6 +70,7 @@
mh_installjar -pant-optional -l src/etc/poms/ant-apache-oro/pom.xml build/lib/ant-apache-oro.jar /usr/share/ant/lib/ant-apache-oro.jar
mh_installjar -pant-optional -l src/etc/poms/ant-apache-regexp/pom.xml build/lib/ant-apache-regexp.jar /usr/share/ant/lib/ant-apache-regexp.jar
mh_installjar -pant-optional -l src/etc/poms/ant-apache-resolver/pom.xml build/lib/ant-apache-resolver.jar /usr/share/ant/lib/ant-apache-resolver.jar
+ mh_installjar -pant-optional -l src/etc/poms/ant-apache-xalan2/pom.xml build/lib/ant-apache-xalan2.jar /usr/share/ant/lib/ant-apache-xalan2.jar
mh_installjar -pant-optional -l src/etc/poms/ant-commons-logging/pom.xml build/lib/ant-commons-logging.jar /usr/share/ant/lib/ant-commons-logging.jar
mh_installjar -pant-optional -l src/etc/poms/ant-commons-net/pom.xml build/lib/ant-commons-net.jar /usr/share/ant/lib/ant-commons-net.jar
mh_installjar -pant-optional -l src/etc/poms/ant-javamail/pom.xml build/lib/ant-javamail.jar /usr/share/ant/lib/ant-javamail.jar
@@ -78,10 +79,12 @@
mh_installjar -pant-optional -l src/etc/poms/ant-jsch/pom.xml build/lib/ant-jsch.jar /usr/share/ant/lib/ant-jsch.jar
mh_installjar -pant-optional -l src/etc/poms/ant-junit/pom.xml build/lib/ant-junit.jar /usr/share/ant/lib/ant-junit.jar
mh_installjar -pant-optional -l src/etc/poms/ant-nodeps/pom.xml build/lib/ant-nodeps.jar /usr/share/ant/lib/ant-nodeps.jar
+ #mh_installjar -pant-optional -l src/etc/poms/ant-stylebook/pom.xml build/lib/ant-stylebook.jar /usr/share/ant/lib/ant-stylebook.jar
+ dh_install -pant-optional build/lib/ant-stylebook.jar /usr/share/ant/lib/
+ dh_link -pant-optional /usr/share/ant/lib/ant-stylebook.jar /usr/share/java/ant-stylebook.jar
mh_installjar -pant-optional -l src/etc/poms/ant-swing/pom.xml build/lib/ant-swing.jar /usr/share/ant/lib/ant-swing.jar
mh_installjar -pant-optional -l src/etc/poms/ant-trax/pom.xml build/lib/ant-trax.jar /usr/share/ant/lib/ant-trax.jar
#mh_installjar -pant-optional src/etc/poms/ant-testutil/pom.xml ant-testutil/build/ant-testutil-$(VERSION).jar
- #mh_installjar -pant-optional src/etc/poms/ant-stylebook/pom.xml ant-stylebook/build/ant-stylebook-$(VERSION).jar
#mh_installjar -pant-optional src/etc/poms/ant-jai/pom.xml ant-jai/build/ant-jai-$(VERSION).jar
#mh_installjar -pant-optional src/etc/poms/ant-netrexx/pom.xml ant-netrexx/build/ant-netrexx-$(VERSION).jar
#mh_installjar -pant-optional src/etc/poms/ant-starteam/pom.xml ant-starteam/build/ant-starteam-$(VERSION).jar
Modified: trunk/ant/debian/watch
===================================================================
--- trunk/ant/debian/watch 2010-02-14 22:53:35 UTC (rev 11605)
+++ trunk/ant/debian/watch 2010-02-16 21:19:57 UTC (rev 11606)
@@ -1,2 +1,2 @@
version=2
-http://www.apache.org/dist/ant/source/apache-ant-(.*)-src\.tar\.gz debian uupdate
+http://www.apache.org/dist/ant/source/apache-ant-(.*)-src\.tar\.gz debian debian/orig-tar.sh
More information about the pkg-java-commits
mailing list