Browse Source

called "javadoc" directly to avoid classpath problems that bugged many cocoon devs (it didn't happen to me because was setting tools.jar in my autoexec.bat... now I have a clean classpath and everything works fine on both 1.2 and 1.1

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267626 13f79535-47bb-0310-9956-ffa450edef68
master
Stefano Mazzocchi 25 years ago
parent
commit
ef962a9a03
1 changed files with 7 additions and 16 deletions
  1. +7
    -16
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java

+ 7
- 16
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -79,9 +79,6 @@ import java.util.*;


public class Javadoc extends Exec { public class Javadoc extends Exec {


private static final String JAVADOC1 = "sun.tools.javadoc.Main";
private static final String JAVADOC2 = "com.sun.tools.javadoc.Main";
private String sourcePath = null; private String sourcePath = null;
private File destDir = null; private File destDir = null;
private File overviewFile = null; private File overviewFile = null;
@@ -261,9 +258,9 @@ public class Javadoc extends Exec {
argList.addElement("-sourcepath"); argList.addElement("-sourcepath");
argList.addElement(sourcePath); argList.addElement(sourcePath);
} }
} else {
} else {
argList.addElement("-classpath"); argList.addElement("-classpath");
argList.addElement(sourcePath +
argList.addElement(sourcePath +
System.getProperty("path.separator") + classpath); System.getProperty("path.separator") + classpath);
} }


@@ -411,14 +408,8 @@ public class Javadoc extends Exec {
project.log("Javadoc execution", project.MSG_INFO); project.log("Javadoc execution", project.MSG_INFO);


StringBuffer b = new StringBuffer(); StringBuffer b = new StringBuffer();
b.append("java ");
if (javadoc1) {
b.append(JAVADOC1);
} else {
b.append(JAVADOC2);
}
b.append(" ");
b.append("javadoc ");

Enumeration e = argList.elements(); Enumeration e = argList.elements();
while (e.hasMoreElements()) { while (e.hasMoreElements()) {
String arg = (String) e.nextElement(); String arg = (String) e.nextElement();
@@ -431,7 +422,7 @@ public class Javadoc extends Exec {
} }
if (e.hasMoreElements()) b.append(" "); if (e.hasMoreElements()) b.append(" ");
} }
run(b.toString()); run(b.toString());
} }


@@ -554,10 +545,10 @@ public class Javadoc extends Exec {
} }


/** /**
* This is a java comment and string stripper reader that filters
* This is a java comment and string stripper reader that filters
* these lexical tokens out for purposes of simple Java parsing. * these lexical tokens out for purposes of simple Java parsing.
* (if you have more complex Java parsing needs, use a real lexer). * (if you have more complex Java parsing needs, use a real lexer).
* Since this class heavily relies on the single char read function,
* Since this class heavily relies on the single char read function,
* you are reccomended to make it work on top of a buffered reader. * you are reccomended to make it work on top of a buffered reader.
*/ */
class JavaReader extends FilterReader { class JavaReader extends FilterReader {


Loading…
Cancel
Save