Browse Source

Add linksource attribute to Javadoc.

Submitted by:	<smagoun at mac dot com>

Add breakiterator attribute to Javadoc.

PR: 11569


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274479 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
39b1929142
2 changed files with 55 additions and 2 deletions
  1. +18
    -2
      docs/manual/CoreTasks/javadoc.html
  2. +37
    -0
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java

+ 18
- 2
docs/manual/CoreTasks/javadoc.html View File

@@ -40,7 +40,7 @@ versions, you are strongly encouraged to use <a href="javadoc.html">javadoc</a>
instead.</i></p> instead.</i></p>


<p>In the table below, 1.1 means available if your current Java VM is <p>In the table below, 1.1 means available if your current Java VM is
a 1.1 VM, 1.2 for either 1.2 or 1.3 and 1.4 for a 1.4 Java VM. 1.2+
a 1.1 VM, 1.2 for either 1.2 or 1.3 and 1.4+ for any VM of at least version 1.4. 1.2+
means any VM of at least version 1.2.</p> means any VM of at least version 1.2.</p>


<h3>Parameters</h3> <h3>Parameters</h3>
@@ -397,7 +397,23 @@ means any VM of at least version 1.2.</p>
present in J2SE v 1.4 source code. Set this to &quot;1.4&quot; to present in J2SE v 1.4 source code. Set this to &quot;1.4&quot; to
documents code that compiles using <code>&quot;javac -source documents code that compiles using <code>&quot;javac -source
1.4&quot;</code>.</td> 1.4&quot;</code>.</td>
<td align="center" valign="top">1.4</td>
<td align="center" valign="top">1.4+</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">linksource</td>
<td valign="top">Generate hyperlinks to source files.
<em>since Ant 1.6</em>.
(<code>yes</code> | <code>no</code>). Default is no.</td>
<td align="center" valign="top">1.4+</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">breakiterator</td>
<td valign="top">Use the new breakiterator algorithm.
<em>since Ant 1.6</em>.
(<code>yes</code> | <code>no</code>). Default is no.</td>
<td align="center" valign="top">1.4+</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
</table> </table>


+ 37
- 0
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -466,6 +466,8 @@ public class Javadoc extends Task {
private boolean useExternalFile = false; private boolean useExternalFile = false;
private FileUtils fileUtils = FileUtils.newFileUtils(); private FileUtils fileUtils = FileUtils.newFileUtils();
private String source = null; private String source = null;
private boolean linksource = false;
private boolean breakiterator = false;


private Vector fileSets = new Vector(); private Vector fileSets = new Vector();
private Vector packageSets = new Vector(); private Vector packageSets = new Vector();
@@ -1502,6 +1504,34 @@ public class Javadoc extends Task {
fileSets.addElement(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) {
if (!javadoc4) {
log ("-linksource option not supported on JavaDoc < 1.4",
Project.MSG_VERBOSE);
}
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) {
if (!javadoc4) {
log ("-breakiterator option not supported on JavaDoc < 1.4",
Project.MSG_VERBOSE);
}
this.breakiterator = b;
}

public void execute() throws BuildException { public void execute() throws BuildException {
if ("javadoc2".equals(getTaskType())) { if ("javadoc2".equals(getTaskType())) {
log("!! javadoc2 is deprecated. Use javadoc instead. !!"); log("!! javadoc2 is deprecated. Use javadoc instead. !!");
@@ -1793,6 +1823,13 @@ public class Javadoc extends Task {
toExecute.createArgument().setValue("-source"); toExecute.createArgument().setValue("-source");
toExecute.createArgument().setValue(source); toExecute.createArgument().setValue(source);
} }
if (linksource && doclet == null) {
toExecute.createArgument().setValue("-linksource");
}
if (breakiterator && doclet == null) {
toExecute.createArgument().setValue("-breakiterator");
}
} }


} }


Loading…
Cancel
Save