Index: settings/ptolemy-includes =================================================================== --- settings/ptolemy-includes (revision 29120) +++ settings/ptolemy-includes (working copy) @@ -2,6 +2,7 @@ diva/**/*.java diva/**/*.xml diva/**/*.gif +doc/doclets/*.java lib/diva.jar lib/ptjacl.jar lib/jython.jar @@ -16,4 +17,4 @@ ptolemy/vergil/pdfrenderer/*.jar util/**/*.java util/**/*.xml -util/**/*.gif \ No newline at end of file +util/**/*.gif Index: target/kepler-tasks.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: src/org/kepler/build/CreateJavadoc.java =================================================================== --- src/org/kepler/build/CreateJavadoc.java (revision 29121) +++ src/org/kepler/build/CreateJavadoc.java (working copy) @@ -27,9 +27,11 @@ import org.apache.tools.ant.taskdefs.Delete; import org.apache.tools.ant.taskdefs.Expand; import org.apache.tools.ant.types.FileSet; +import org.apache.tools.ant.types.Path; import org.kepler.build.modules.Module; import org.kepler.build.modules.ModulesTask; -import org.kepler.build.project.RunClasspath; +import org.kepler.build.project.CompileClasspath; +import org.kepler.build.project.ProjectLocator; import org.kepler.build.util.StreamSingleCommandExec; import java.io.BufferedReader; @@ -53,6 +55,7 @@ protected boolean full; protected List command = new ArrayList(); protected String sourcepath = ""; + protected Path classpath = new Path(ProjectLocator.getAntProject()); /** * set the module to create javadocs for @@ -133,6 +136,7 @@ if (moduleName.equals("undefined")) { addModuleSourcepaths(); + addModuleCompilepaths(); // If -Dfull=true is specified, produce and link to documentation for Kepler and Ptolemy as well. if (full) { @@ -142,7 +146,9 @@ // Produce javadoc for only one module. else { - addSourcepath(Module.make(moduleName)); + Module m = Module.make(moduleName); + addSourcepath(m); + addCompilepath(m); } // Always include build-area, the core/loader needs it. @@ -153,21 +159,14 @@ addToCommand("-d " + destDir.getAbsolutePath()); addToCommand("-sourcepath " + sourcepath); - // FIXME: this is weak, what happens when the jar is updated. - // We should switch to the native logger anyway. - String commonsLogging = Module.make("util").getLibDir() - + "/jar/commons-logging-1.1.jar"; - String ant = Module.make("build-area").getLibDir() + "/ant.jar"; - RunClasspath rcp = new RunClasspath(); - //CompileClasspath ccp = new CompileClasspath(); - addToCommand("-classpath " + _ptolemyClassPath() + File.pathSeparator + commonsLogging - + File.pathSeparator + ant); - //addToCommand("-classpath " + rcp.toString()); + addDefaultCompilePath(); + addToCommand("-classpath " + classpath.toString()); + // Needed for RatingTaglet String tasks = Module.make("build-area").getTargetDir() + "/kepler-tasks.jar"; - addToCommand("-tagletpath " + tasks); + addToCommand("-tagletpath " + Module.make("ptolemy").getTargetDir() + "/classes"); // FIXME: what about os dependent excludes String ptolemyExcludes = _ptolemyExcludes(); @@ -177,7 +176,7 @@ } specifyPackages("org", "com", "util", "ptolemy"); - addToCommand("-link http://docs.oracle.com/javase/6/docs/api/"); + addToCommand("-link http://download.oracle.com/javase/6/docs/api/"); command.add("-linksource"); command.add("-author"); command.add("-breakiterator"); @@ -186,7 +185,7 @@ addToCommand("-tag Pt.AcceptedRating -tag Pt.ProposedRating "); addToCommand("-tag category.name -tag UserLevelDocumentation "); addToCommand("-tag created -tag entity.description -tag status"); - addToCommand("-taglet org.kepler.build.RatingTaglet"); + addToCommand("-taglet doc.doclets.RatingTaglet"); command.add("-J-Xmx768m"); final StreamSingleCommandExec exec = new StreamSingleCommandExec(); @@ -195,6 +194,18 @@ } /** + * Include default classpath for all javadoc builds. + */ + protected void addDefaultCompilePath() + { + classpath.addFileset(_getPtolemyFileSet()); + classpath.append(new Path(ProjectLocator.getAntProject(), + new File(System.getenv().get("JAVA_HOME"), + "/lib/tools.jar").getAbsolutePath())); + addCompilepath(Module.make("build-area")); + } + + /** * Expand source in a jar and add it to the set of files for which javadoc is * to be produced. * @@ -255,7 +266,7 @@ } /** - * Add the source path from which javadoc should be produced for one module. + * Add the compile path from which javadoc should be produced for one module. * * @param module The module for which javadoc should be produced. */ @@ -269,16 +280,42 @@ } /** + * Add compile paths from which javadoc should be produced for all the modules. + */ + protected void addModuleCompilepaths() + { + for (Module module : moduleTree) + { + addCompilepath(module); + } + } + + /** + * Add the source path from which javadoc should be produced for one module. + * + * @param module The module for which javadoc should be produced. + */ + protected void addCompilepath(Module module) + { + if (!module.getSrc().isDirectory()) + { + return; + } + CompileClasspath path = new CompileClasspath(module); + classpath.append(path); + } + + /** * Return a File.pathSeparator separated list of Ptolemy jar files. * * @return a File.pathSeparator separated list of Ptolemy jar files. */ - private String _ptolemyClassPath() + private FileSet _getPtolemyFileSet() { PtolemyPathGenerator ptolemyPathGenerator = PtolemyPathGenerator .getInstance(); FileSet fileSet = ptolemyPathGenerator.getFileset(); - return fileSet.toString().replace(";", File.pathSeparator); + return fileSet; } /**