Bug 53849 - Unable to restrict the packages for javadoc by using packageList
Summary: Unable to restrict the packages for javadoc by using packageList
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.9.1
Hardware: Sun Solaris
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-11 13:14 UTC by Bernd Ernesti
Modified: 2018-01-25 17:30 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Ernesti 2012-09-11 13:14:36 UTC
With ant 1.6.5 we used a javadoc task with sourcepathref and a packageList where packageList contains a list of packages which should only be used.

Now with 1.8.4 the javadoc command is called (by Java13CommandLauncher) with all package names instead of only the package names from the packageList.
The filename from packageList is still added at the end of the javadoc command line option.


 <property name="packagefile" value="${J_ROOT}/doc/package.lst"/>
 <path id="src.dirs">
   <dirset dir="${J_ROOT}/projects">
    <include name="**/src/main/java"/>
   </dirset>
 </path>

 <javadoc sourcepathref="src.dirs" destdir="${htmldestdir}"
  packageList="${packagefile}"
  Windowtitle="${windowtitle}" Doctitle="${doctitle}" Use="true"
  Splitindex="true" maxmemory="512M"
  overview="${overviewfile}" classpathref="classpath.extra"
  Version="${version}" Author="${author}">
 </javadoc>
Comment 1 Stefan Bodewig 2014-01-05 10:35:04 UTC
You are correct but I'm tempted to say it is by design:

> NOTE: the packagelist attribute allows you to specify the list of packages to document outside of the Ant file. It's a much better practice to include everything inside the build.xml file. This option was added in order to make it easier to migrate from regular makefiles, where you would use this option of javadoc. The packages listed in packagelist are not checked, so the task performs even if some packages are missing or broken. Use this option if you wish to convert from an existing makefile. Once things are running you should then switch to the regular notation.
Comment 2 Jim Gish 2018-01-25 17:30:37 UTC
Seems pretty clear it is not by design.  Debugging through the 1.9.8 code, on line 1787 of Javadoc.java, you'll see:
        if (packageList != null) {
            toExecute.createArgument().setValue("@" + packageList);
        }
        log(toExecute.describeCommand(), Project.MSG_VERBOSE);
The command line after this point does not have the "@packageListFile" specified, but rather all packages found in the sources.  This is a bug.