Example 2

Create API documentation for the Schmant Java source files in the directory hierarchy under src. Put the documentation in the directory doc. Use the PDF doclet (creating PDF documentation).

Groovy

// Enable the PDF doclet task package in the script header // enableTaskPackage com.tarsec.javadoc.pdfdoclet import org.entityfs.util.CharSequenceReadableFile import org.schmant.support.FutureFile import org.schmant.task.jdk.javadoc.ext.ExtJavadocTF import org.schmant.task.jdk.javadoc.pdfdoclet.ext.ExtPdfDocletDecorator new ExtJavadocTF(). addSource(src). addPackageName("org.schmant"). setSubPackages(true). addClasspathEntry(dependencies.get("junit4")). addDecorator( new ExtPdfDocletDecorator(). setTarget(new FutureFile(doc, "doc.pdf")). // Use an inline file setConfigFile( new CharSequenceReadableFile( "author=yes\n" + "tag.since=yes\n" + "allow.printing=yes"))).run()

JavaScript

// Enable the pdfdoclet task package enableTaskPackage("com.tarsec.javadoc.pdfdoclet"); new ExtJavadocTF(). addSource(src). addPackageName("org.schmant"). setSubPackages(true). addClasspathEntry(dependencies.get("junit4")). addDecorator( new ExtPdfDocletDecorator(). setTarget(new FutureFile(doc, "doc.pdf")). // Use an inline file setConfigFile( new CharSequenceReadableFile( "author=yes\n" + "tag.since=yes\n" + "allow.printing=yes"))).run();

Example 3

Create API documentation for the Schmant Java source files in the directory hierarchy under src. Put the documentation in the directory doc. Define the custom tag @injar and allow it occur in type documentation. Use the standard doclet (creating HTML documentation).

JavaScript

// The dependencies variable is a Map with Jar files mapped under // dependency names, for instance "junit4" -> junit4-4.2.jar new ExtJavadocTF(). addSource(src). addPackageName("org.schmant"). setSubPackages(true). addClasspathEntry(dependencies.get("junit4")). addTag(JavadocTagDefinition.createTag("injar"). addPlace(JavadocTagPlace.TYPES). // A bug in the javadoc command prevents us from using // a space in this text. (Java bug #6447784) setTagText("In_jar:")). addDecorator( new ExtStandardDocletDecorator(). setTarget(doc). setWindowTitle("Schmant Javadocs")).run();


* That a task is not EntityFS-aware means that it is not aware of DirectoryView filters (it uses them as plain Directory:s) and also that it usually requires that the entities it takes as arguments are in a File-based file file system. (That they are ECFileResolvable.) A non File-resolvable entity can be made so by using the SchmantFileSystems.makeFileResolvable(org.entityfs.EFile) method.