glennm      01/02/06 06:26:10

  Modified:    docs     Tag: ANT_13_BRANCH index.html
               src/main/org/apache/tools/ant/taskdefs Tag: ANT_13_BRANCH
                        Javadoc.java
  Log:
  Add exclude package capability.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.202.2.1 +10 -2     jakarta-ant/docs/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/index.html,v
  retrieving revision 1.202
  retrieving revision 1.202.2.1
  diff -u -r1.202 -r1.202.2.1
  --- index.html        2001/02/04 13:08:52     1.202
  +++ index.html        2001/02/06 14:26:08     1.202.2.1
  @@ -34,7 +34,7 @@
   
   <center>
   <p>Version: @VERSION@<br>
  -$Id: index.html,v 1.202 2001/02/04 13:08:52 nico Exp $</p>
  +$Id: index.html,v 1.202.2.1 2001/02/06 14:26:08 glennm Exp $</p>
   </center>
   
   <hr>
  @@ -3562,7 +3562,8 @@
   <h3>Description</h3>
   <p>Generates code documentation using the javadoc tool.</p>
   <p>The source directory will be recursively scanned for Java source files to 
process
  -but only those matching the inclusion rules will be passed to the javadoc 
tool. This
  +but only those matching the inclusion rules, and not matching the exclusions 
rules
  + will be passed to the javadoc tool. This
   allows wildcards to be used to choose between package names, reducing 
verbosity
   and management costs over time. This task, however, has no notion of
   &quot;changed&quot; files, unlike the <a href="#javac">javac</a> task. This 
means
  @@ -3632,6 +3633,13 @@
       <td valign="top">Comma separated list of package files (with terminating
         wildcard)</td>
       <td align="center" valign="top">all</td>
  +  </tr>
  +  <tr>
  +    <td valign="top">excludepackagenames</td>
  +    <td valign="top">Comma separated list of package files to exlclude (with
  +      optional terminating wildcard)</td>
  +    <td align="center" valign="top">all</td>
  +    <td align="center" valign="top">No</td>
     </tr>
     <tr>
       <td valign="top">packageList</td>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.43.2.1  +28 -2     
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
  retrieving revision 1.43
  retrieving revision 1.43.2.1
  diff -u -r1.43 -r1.43.2.1
  --- Javadoc.java      2001/01/24 16:56:46     1.43
  +++ Javadoc.java      2001/02/06 14:26:10     1.43.2.1
  @@ -193,6 +193,7 @@
       private File destDir = null;
       private String sourceFiles = null;
       private String packageNames = null;
  +     private String excludePackageNames = null;
       private boolean author = true;
       private boolean version = true;
       private DocletInfo doclet = null;
  @@ -260,6 +261,11 @@
       public void setPackagenames(String src) {
           packageNames = src;
       }
  +
  +     public void setExcludePackageNames(String src) {
  +             excludePackageNames = src;
  +     }
  +
       public void setOverview(File f) {
           if (!javadoc1) {
               cmd.createArgument().setValue("-overview");
  @@ -722,8 +728,16 @@
                       toExecute.createArgument().setValue(name);
                   }
               }
  +
  +                     Vector excludePackages = new Vector();
  +                     if ((excludePackageNames != null) && 
(excludePackageNames.length() > 0)) {
  +                             StringTokenizer exTok = new 
StringTokenizer(excludePackageNames, ",", false);
  +                             while (exTok.hasMoreTokens()) {
  +                                     
excludePackages.addElement(exTok.nextToken().trim());
  +                             }
  +                     }
               if (packages.size() > 0) {
  -                evaluatePackages(toExecute, sourcePath, packages);
  +                evaluatePackages(toExecute, sourcePath, packages, 
excludePackages);
               }
           }
   
  @@ -770,9 +784,10 @@
        * patterns.
        */
       private void evaluatePackages(Commandline toExecute, Path sourcePath, 
  -                                  Vector packages) {
  +                                  Vector packages, Vector excludePackages) {
           log("Source path = " + sourcePath.toString(), Project.MSG_VERBOSE);
           log("Packages = " + packages, Project.MSG_VERBOSE);
  +             log("Exclude Packages = " + excludePackages, 
Project.MSG_VERBOSE);
   
           Vector addedPackages = new Vector();
   
  @@ -792,6 +807,17 @@
   
               fs.createInclude().setName(pkg);
           } // while
  +
  +             e = excludePackages.elements();
  +             while (e.hasMoreElements()) {
  +                     String pkg = (String)e.nextElement();
  +                     pkg = pkg.replace('.','/');
  +                     if (pkg.endsWith("*")) {
  +                             pkg += "*";
  +                     }
  +
  +                     fs.createExclude().setName(pkg);
  +             }
   
           for (int j=0; j<list.length; j++) {
               File source = project.resolveFile(list[j]);
  
  
  

Reply via email to