From a68bd225333b6acf66b9e8cfbf381806d14078ac Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Mon, 24 Nov 2008 09:31:32 +0000 Subject: [PATCH] remove non-1.4 stuff from javadoc git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@720143 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/javadoc.html | 17 +++-- .../apache/tools/ant/taskdefs/Javadoc.java | 62 +++---------------- 2 files changed, 16 insertions(+), 63 deletions(-) diff --git a/docs/manual/CoreTasks/javadoc.html b/docs/manual/CoreTasks/javadoc.html index 4f1129a21..0f4736255 100644 --- a/docs/manual/CoreTasks/javadoc.html +++ b/docs/manual/CoreTasks/javadoc.html @@ -35,9 +35,6 @@ and management costs over time. This task, however, has no notion of "changed" files, unlike the javac task. This means all packages will be processed each time this task is run. In general, however, this task is used much less frequently.

-

This task works seamlessly between different javadoc versions (1.2 and 1.4), -with the obvious restriction that the 1.4 attributes -will be ignored if run in a 1.2 VM.

NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the same VM as Ant without breaking functionality. For this reason, this task always forks the VM. This overhead is not significant since javadoc is normally a heavy @@ -58,7 +55,7 @@ instead.

In the table below, 1.2 means available if your current Java VM is a 1.2 VM (but not 1.3 or later), 1.4+ for any VM of at least version 1.4, otherwise -any VM of at least version 1.2 is acceptable. JDK 1.1 is no longer supported. +any VM of at least version 1.2 is acceptable. JDKs <1.4 are no longer supported. If you specify the executable attribute it is up to you to ensure that this command supports the attributes you wish to use.

@@ -202,7 +199,11 @@ to <javadoc> using classpath, classpathref attributes or Old - Generate output using JDK 1.1 emulating doclet + Generate output using JDK 1.1 emulating + doclet.
+ Note: as of Ant 1.8.0 this attribute doesn't have any + effect since the javadoc of Java 1.4 (required by Ant 1.8.0) + doesn't support the -1.1 switch anymore. 1.2 No @@ -703,9 +704,6 @@ of the doclet element is shown below:

tag

-

The tag nested element is used to specify custom tags. This option -is only available with Java 1.4.

-

If you want to specify a standard tag using a nested tag element because you want to determine the order the tags are output, you must not set the description attribute for those tags.

@@ -764,8 +762,7 @@ the javadoc program.

taglet

The taglet nested element is used to specify custom -taglets. -This option is only available with Java 1.4 or newer.

+ taglets.

Parameters
diff --git a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java index 2d83f3b8e..b121240a9 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java +++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java @@ -77,12 +77,8 @@ import org.apache.tools.ant.util.JavaEnvUtils; public class Javadoc extends Task { // Whether *this VM* is 1.4+ (but also check executable != null). - private static final boolean JAVADOC_4 = - !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) - && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3); - - private static final boolean JAVADOC_5 = JAVADOC_4 - && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_4); + private static final boolean JAVADOC_5 = + !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_4); /** * Inner class used to manage doclet parameters. @@ -452,7 +448,6 @@ public class Javadoc extends Task { private boolean breakiterator = false; private String noqualifier; private boolean includeNoSourcePackages = false; - private boolean old = false; private String executable = null; private ResourceCollectionContainer nestedSourceFiles @@ -766,7 +761,8 @@ public class Javadoc extends Task { * @param b if true attempt to generate old style documentation. */ public void setOld(boolean b) { - old = b; + log("Javadoc 1.4 doesn't support the -1.1 switch anymore", + Project.MSG_WARN); } /** @@ -1678,28 +1674,12 @@ public class Javadoc extends Task { doGroup(toExecute); // group attribute doGroups(toExecute); // groups attribute - // Javadoc 1.4 parameters - if (JAVADOC_4 || executable != null) { - doJava14(toExecute); - if (breakiterator && (doclet == null || JAVADOC_5)) { - toExecute.createArgument().setValue("-breakiterator"); - } - } else { - doNotJava14(); - } - // Javadoc 1.2/1.3 parameters: - if (!JAVADOC_4 || 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); - } + doJava14(toExecute); + if (breakiterator && (doclet == null || JAVADOC_5)) { + toExecute.createArgument().setValue("-breakiterator"); } // If using an external file, write the command line options to it - if (useExternalFile && JAVADOC_4) { + if (useExternalFile) { writeExternalArgs(toExecute); } @@ -2151,30 +2131,6 @@ public class Javadoc extends Task { } } - private void doNotJava14() { - // 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); - } - } - private void doSourceAndPackageNames( Commandline toExecute, Vector packagesToDoc, @@ -2200,7 +2156,7 @@ public class Javadoc extends Task { if (useExternalFile) { // XXX what is the following doing? // should it run if !javadoc4 && executable != null? - if (JAVADOC_4 && sourceFileName.indexOf(" ") > -1) { + if (sourceFileName.indexOf(" ") > -1) { String name = sourceFileName; if (File.separatorChar == '\\') { name = sourceFileName.replace(File.separatorChar, '/');