From 05a1f53cbd6426c29e95d793b5855edca7abfbbf Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 14 May 2003 15:01:12 +0000 Subject: [PATCH] Similar to PR: 10499, filenames passed in via @argfile needs to be quoted if they contain spaces in JDK 1.4's javadoc. PR: 16871 Enable usage of standard tags in by making description optional. PR: 18912 Support the -noqualifier switch. PR: 19288 Add nested as a more convenient alternative to additionalparams. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274578 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 12 +++++ docs/manual/CoreTasks/javadoc.html | 21 ++++++++- .../apache/tools/ant/taskdefs/Javadoc.java | 44 ++++++++++++++++--- 3 files changed, 69 insertions(+), 8 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 292c8eabc..a446214e7 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -124,6 +124,9 @@ Fixed bugs: * URL-encoding in didn't work properly. +* file names that include spaces need to be quoted inside the @argfile + argument using and JDK 1.4. Bugzilla Report 16871. + Other changes: -------------- * Six new Clearcase tasks added. @@ -319,6 +322,15 @@ Other changes: * A new task has been added that requires commons-net to work. Bugzilla Report 19541. +* now supports a nested element in addition to the + additionalparams attribute. + +* You can now determine the order of standard tags in via + elements - you must not use the description attribute for them. + Bugzilla Report 18912. + +* now supports the -noqualifier switch. Bugzilla Report 19288. + Changes from Ant 1.5.2 to Ant 1.5.3 =================================== diff --git a/docs/manual/CoreTasks/javadoc.html b/docs/manual/CoreTasks/javadoc.html index d0d818a10..9bed53003 100644 --- a/docs/manual/CoreTasks/javadoc.html +++ b/docs/manual/CoreTasks/javadoc.html @@ -416,6 +416,14 @@ means any VM of at least version 1.2.

1.4+ No + + noqualifier + Enables the -noqualifier argument - + must be all or a colon separated list of packages. + since Ant 1.6. + 1.4+ + No +

Format of the group attribute

@@ -608,6 +616,10 @@ of the doclet element is shown below:

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

+

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.

+
Parameters
@@ -623,7 +635,8 @@ is only available with Java 1.4.

- + @@ -690,6 +703,12 @@ structure and can also be set via nested sourcepath, classpath and bootclasspath elements respectively.

+

arg

+ +

Use nested <arg> to specify additional +arguments. See Command line +arguments. Since Ant 1.6

+

Example

  <javadoc packagenames="com.dummy.test.*"
            sourcepath="src"
diff --git a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
index 8ce73804b..2ec0030a4 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
@@ -468,6 +468,7 @@ public class Javadoc extends Task {
     private String source = null;
     private boolean linksource = false;
     private boolean breakiterator = false;
+    private String noqualifier;
 
     private Vector fileSets = new Vector();
     private Vector packageSets = new Vector();
@@ -518,6 +519,14 @@ public class Javadoc extends Task {
         cmd.createArgument().setLine(add);
     }
 
+    /**
+     * Adds a command-line argument.
+     * @since Ant 1.6
+     */
+    public Commandline.Argument createArg() {
+        return cmd.createArgument();
+    }
+
     /**
      * Specify where to find source file
      *
@@ -1382,13 +1391,12 @@ public class Javadoc extends Task {
             if (name == null || name.equals("")) {
                 throw new BuildException ("No name specified for custom tag.");
             }
-            if (description == null || description.equals("")){
-                throw new BuildException
-                    ("No description specified for custom tag " + name);
+            if (description != null) {
+                return name + ":" + (enabled ? "" : "X")
+                    + scope + ":" + description;
+            } else {
+                return name;
             }
-
-            return name + ":" + (enabled ? "" : "X")
-                + scope + ":" + description;
         }
     }
 
@@ -1532,6 +1540,20 @@ public class Javadoc extends Task {
         this.breakiterator = b;       
     }
 
+    /**
+     * Enables the -noqualifier switch, will be ignored if javadoc is not
+     * the 1.4 version.
+     *
+     * @since Ant 1.5
+     */
+    public void setNoqualifier(String noq) {
+        if (!javadoc4) {
+            log ("-noqualifier option not supported on JavaDoc < 1.4",
+                 Project.MSG_VERBOSE);
+        }
+        this.noqualifier = noqualifier;
+    }
+
     public void execute() throws BuildException {
         if ("javadoc2".equals(getTaskType())) {
             log("!! javadoc2 is deprecated. Use javadoc instead. !!");
@@ -1830,6 +1852,10 @@ public class Javadoc extends Task {
                 if (breakiterator && doclet == null) {
                     toExecute.createArgument().setValue("-breakiterator");
                 }
+                if (noqualifier != null && doclet == null) {
+                    toExecute.createArgument().setValue("-noqualifier");
+                    toExecute.createArgument().setValue(noqualifier);
+                }
             }
 
         }
@@ -1868,7 +1894,11 @@ public class Javadoc extends Task {
                 SourceFile sf = (SourceFile) enum.nextElement();
                 String sourceFileName = sf.getFile().getAbsolutePath();
                 if (useExternalFile) {
-                    srcListWriter.println(sourceFileName);
+                    if (javadoc4 && sourceFileName.indexOf(" ") > -1) {
+                        srcListWriter.println("\"" + sourceFileName + "\"");
+                    } else {
+                        srcListWriter.println(sourceFileName);
+                    }
                 } else {
                     toExecute.createArgument().setValue(sourceFileName);
                 }
description Description for tag (e.g. To do:)Yes, unless the dir attribute is specified.Yes, unless the dir + attribute is specified or name is a standard tag.
enabled