bodewig 2005/03/17 01:34:03 Modified: . WHATSNEW docs/manual/CoreTasks javadoc.html src/main/org/apache/tools/ant/taskdefs Javadoc.java Log: Optionally create javadocs for packages that only contain a package.html file. PR: 25339 Revision Changes Path 1.783 +4 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.782 retrieving revision 1.783 diff -u -r1.782 -r1.783 --- WHATSNEW 17 Mar 2005 08:10:49 -0000 1.782 +++ WHATSNEW 17 Mar 2005 09:34:01 -0000 1.783 @@ -281,6 +281,10 @@ This was confusing so the definitions are now treated as similar. Bugzilla Report 31215. +* <javadoc> has a new attribute "includenosourcepackages" that can be + used to document packages that don't hold source files but a + package.html file. Bugzilla Report 25339. + Fixed bugs: ----------- 1.32 +11 -2 ant/docs/manual/CoreTasks/javadoc.html Index: javadoc.html =================================================================== RCS file: /home/cvs/ant/docs/manual/CoreTasks/javadoc.html,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- javadoc.html 17 Mar 2005 09:06:22 -0000 1.31 +++ javadoc.html 17 Mar 2005 09:34:01 -0000 1.32 @@ -433,6 +433,14 @@ <td align="center" valign="top">1.4+</td> <td align="center" valign="top">No</td> </tr> + <tr> + <td valign="top">includenosourcepackages</td> + <td valign="top">If set to true, packages that don't contain Java + source but a package.html will get documented as well. + <em>since Ant 1.6.3</em>.</td> + <td align="center" valign="top">all</td> + <td align="center" valign="top">No (default is <code>false</code>)</td> + </tr> </table> <h4><a name="groupattribute">Format of the group attribute</a></h4> @@ -465,8 +473,9 @@ <p>A <a href="../CoreTypes/fileset.html">FileSet</a>. All matched files will be passed to javadoc as source files. Ant will -automatically add the include pattern <code>**/*.java</code> to these -filesets.</p> +automatically add the include pattern <code>**/*.java</code> (and +<code>**/package.html</code> if inncludenosourcepackages is true) to +these filesets.</p> <p>Nested filesets can be used to document sources that are in the default package or if you want to exclude certain files from 1.137 +16 -4 ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java Index: Javadoc.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v retrieving revision 1.136 retrieving revision 1.137 diff -u -r1.136 -r1.137 --- Javadoc.java 17 Mar 2005 09:06:22 -0000 1.136 +++ Javadoc.java 17 Mar 2005 09:34:02 -0000 1.137 @@ -434,6 +434,7 @@ private boolean linksource = false; private boolean breakiterator = false; private String noqualifier; + private boolean includeNoSourcePackages = false; private Vector fileSets = new Vector(); private Vector packageSets = new Vector(); @@ -1624,6 +1625,15 @@ } /** + * 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; + } + + /** * Execute the task. * @throws BuildException on error */ @@ -2080,6 +2090,9 @@ 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()); @@ -2152,10 +2165,9 @@ File pd = new File(baseDir, dirs[i]); String[] files = pd.list(new FilenameFilter () { public boolean accept(File dir1, String name) { - if (name.endsWith(".java")) { - return true; - } - return false; // ignore dirs + return name.endsWith(".java") + || (includeNoSourcePackages + && name.equals("package.html")); } });
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]