FlexDoc/Javadoc - IntegrationsFlexDoc Doclet with the Apache Ant automated build system.
Here is an example.
-J-Xmx512m -sourcepath %FDH%\demo -d %FDH%\out -docletpath %FDH%\lib\flexdoc-javadoc.jar -doclet xyz.flexdoc.javadoc.Doclet -template %FDH%\templates\classic\FramedDoc.tpl -p:windowTitle "FlexDoc/Javadoc Demo" -p:docTitle "FlexDoc Ant Demo" -p:include.tag.custom "todo:a:To Do:" -p:include.tag.custom "prj\:type:opt:Project Type:" -format HTML -nodialog -launchviewer=false java8
build.xmlfile that does the same:
Specifying Javadoc task.
The 'maxmemory' attribute sets the maximum heap size
available to the Java VM running Javadoc.
To run that
build.xml file, you can use a Windows BAT specified like the following:
set ANT_HOME=C:\apache-ant set PATH=%ANT_HOME%\bin;%PATH% set JAVA_HOME=C:\Program Files\Java\jdk1.8 call %ANT_HOME%\bin\ant.bat demo
build.xmlfile!) FlexDoc Doclet with the Apache Maven automated build system may be a bit more complicated because they tend to constantly change something. So, what worked some time ago, may be not working now.
However, that holds only for Maven working under MS Windows. Under macOS and Linux, the opposite is true: <additionalparam> does work, but <additionalOptions> is not recognized.
-p:docTitle "FlexDoc/Javadoc & Maven Integration Demo"
-p:include.tag.custom "todo:a:To Do:"
-p:include.tag.custom "prj\\:type:opt:Project Type:"
First, select in the Eclipse main menu the «Project | Generate Javadoc...» item. The following dialog will show up:
Make sure the following settings are specified:
- In the «Javadoc command» field, provide the location of the Javadoc executable in some JDK installed on your system.
- Select «Use Custom Doclet».
In the «Doclet name» field, specify the name of the FlexDoc Doclet main class:
In the «Doclet class path» field, specify the full pathname of the FlexDoc Doclet
Java library file:
flexdoc-javadoc.jar. This file is located in the
'lib'directory of your FlexDoc/Javadoc installation.
- Now, you can click «Next».
In this dialog, check the following fields:
In the «VM options» field, you should specify the maximum memory heap size
available to the JVM that will run Javadoc (512Mb may be just enough).
If you leave this field empty, Javadoc (that is the FlexDoc Doclet) may slow down very much, especially on a big project, and you may get eventually
The «Extra Javadoc options» field is for the doclet-specific options.
All the command-line options processed by FlexDoc Doclet
that you may ever need should be specified here!
In particular, with the -d option you should specify the output directory for the generated documentation.
Also, unless -nodialog option is specified directly, the FlexDoc Doclet will launch the Doclet GUI over Eclipse. (In fact, since Javadoc is run by a different JVM, the Doclet GUI will be completely independent on Eclipse).
Remember also that all missing options that the FlexDoc Doclet may need (including template parameters) will be taken from the generator.config created when the Doclet GUI was invoked the last time. (So, you should not wonder, how FlexDoc Doclet knows some specific settings you did not provide to it.)
To use FlexDoc Doclet with a particular system, basically, you need to know how to specify the following settings:
- The doclet class name
- The doclet class path
- The doclet-specific Javadoc options
- The maximum heap size used by the JVM that runs Javadoc (i.e. how to pass to it the -Xmx option).