Browse Source

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
master
Stefan Bodewig 16 years ago
parent
commit
a68bd22533
2 changed files with 16 additions and 63 deletions
  1. +7
    -10
      docs/manual/CoreTasks/javadoc.html
  2. +9
    -53
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java

+ 7
- 10
docs/manual/CoreTasks/javadoc.html View File

@@ -35,9 +35,6 @@ and management costs over time. This task, however, has no notion of
&quot;changed&quot; files, unlike the <a href="javac.html">javac</a> task. This means
all packages will be processed each time this task is run. In general, however,
this task is used much less frequently.</p>
<p>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.</p>
<p>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.</i></p>

<p>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 &lt;1.4 are no longer supported.
If you specify the <code>executable</code> attribute it is up to you
to ensure that this command supports the attributes you wish to use.</p>

@@ -202,7 +199,11 @@ to &lt;javadoc&gt; using <tt>classpath</tt>, <tt>classpathref</tt> attributes or
</tr>
<tr>
<td valign="top">Old</td>
<td valign="top">Generate output using JDK 1.1 emulating doclet</td>
<td valign="top">Generate output using JDK 1.1 emulating
doclet.<br>
<b>Note:</b> 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.</td>
<td align="center" valign="top">1.2</td>
<td align="center" valign="top">No</td>
</tr>
@@ -703,9 +704,6 @@ of the doclet element is shown below:</p>

<h4><a name="tagelement">tag</a></h4>

<p>The tag nested element is used to specify custom tags. This option
is only available with Java 1.4.</p>

<p>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.</p>
@@ -764,8 +762,7 @@ the javadoc program.

<h4><a name="tagletelement">taglet</a></h4>
<p>The taglet nested element is used to specify custom
<a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/taglet/overview.html">taglets</a>.
This option is only available with Java 1.4 or newer.</p>
<a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/taglet/overview.html">taglets</a>.</p>

<h5>Parameters</h5>
<table width="90%" border="1" cellpadding="2" cellspacing="0">


+ 9
- 53
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -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, '/');


Loading…
Cancel
Save