fixed output directory
This commit is contained in:
parent
529c0d1e55
commit
cf5a753d1f
@ -21,12 +21,12 @@ This library provides a Javadoc Doclet for the generation of Activiti API docume
|
|||||||
<docletArtifact>
|
<docletArtifact>
|
||||||
<groupId>com.inteligr8.activiti</groupId>
|
<groupId>com.inteligr8.activiti</groupId>
|
||||||
<artifactId>activiti-api-doclet</artifactId>
|
<artifactId>activiti-api-doclet</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.1</version>
|
||||||
</docletArtifact>
|
</docletArtifact>
|
||||||
<useStandardDocletOptions>false</useStandardDocletOptions>
|
<useStandardDocletOptions>false</useStandardDocletOptions>
|
||||||
<destDir>destDir</destDir>
|
<destDir>apidocs</destDir>
|
||||||
|
<reportOutputDirectory>${basedir}</reportOutputDirectory>
|
||||||
<additionalOptions>
|
<additionalOptions>
|
||||||
<additionalOption>-d d</additionalOption>
|
|
||||||
<additionalOption>--flavor bitbucket</additionalOption>
|
<additionalOption>--flavor bitbucket</additionalOption>
|
||||||
<additionalOption>--title 'API Documentation'</additionalOption>
|
<additionalOption>--title 'API Documentation'</additionalOption>
|
||||||
<additionalOption>--apiName '${project.name}</additionalOption>
|
<additionalOption>--apiName '${project.name}</additionalOption>
|
||||||
@ -46,4 +46,4 @@ You can generate the docs with the following command:
|
|||||||
mvn -Papidocs generate-resources
|
mvn -Papidocs generate-resources
|
||||||
```
|
```
|
||||||
|
|
||||||
The documentation is always generated relative to the `target/site/apidocs` directory. Hopefully that can be fixed in the future.
|
The documentation will be placed in `<reportOutputDirectory>/<destDir>`.
|
||||||
|
@ -50,10 +50,12 @@
|
|||||||
<version>@pom.version@</version>
|
<version>@pom.version@</version>
|
||||||
</docletArtifact>
|
</docletArtifact>
|
||||||
<useStandardDocletOptions>false</useStandardDocletOptions>
|
<useStandardDocletOptions>false</useStandardDocletOptions>
|
||||||
<destDir>destDir</destDir>
|
<destDir>apidocs</destDir>
|
||||||
|
<reportOutputDirectory>${basedir}</reportOutputDirectory>
|
||||||
<additionalOptions>
|
<additionalOptions>
|
||||||
<additionalOption>-d d</additionalOption>
|
|
||||||
<additionalOption>--flavor bitbucket</additionalOption>
|
<additionalOption>--flavor bitbucket</additionalOption>
|
||||||
|
<additionalOption>--title 'Example Title'</additionalOption>
|
||||||
|
<additionalOption>--apiName '${project.name}'</additionalOption>
|
||||||
</additionalOptions>
|
</additionalOptions>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
@ -44,7 +44,7 @@ import jdk.javadoc.doclet.Reporter;
|
|||||||
public class ActivitiDoclet implements Doclet {
|
public class ActivitiDoclet implements Doclet {
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
private String outputDirectory;
|
|
||||||
private String flavor;
|
private String flavor;
|
||||||
private String title;
|
private String title;
|
||||||
private String apiName;
|
private String apiName;
|
||||||
@ -57,13 +57,6 @@ public class ActivitiDoclet implements Doclet {
|
|||||||
@Override
|
@Override
|
||||||
public Set<? extends Option> getSupportedOptions() {
|
public Set<? extends Option> getSupportedOptions() {
|
||||||
return new HashSet<>(Arrays.asList(
|
return new HashSet<>(Arrays.asList(
|
||||||
new PathOption("-d", "Destination directory for output files", Kind.STANDARD, "--destDir") {
|
|
||||||
@Override
|
|
||||||
public boolean process(String name, List<String> valueAndClasses) {
|
|
||||||
outputDirectory = valueAndClasses.get(0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new ValueOption("--flavor", "Flavor of the markdown host: github or bitbucket", Kind.STANDARD) {
|
new ValueOption("--flavor", "Flavor of the markdown host: github or bitbucket", Kind.STANDARD) {
|
||||||
@Override
|
@Override
|
||||||
public boolean process(String name, List<String> valueAndClasses) {
|
public boolean process(String name, List<String> valueAndClasses) {
|
||||||
@ -122,7 +115,7 @@ public class ActivitiDoclet implements Doclet {
|
|||||||
List<ActivitiApiBeanDoc> beandocs = docfilter.build();
|
List<ActivitiApiBeanDoc> beandocs = docfilter.build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MarkdownWriter mdwriter = new MarkdownWriter(docenv, this.outputDirectory);
|
MarkdownWriter mdwriter = new MarkdownWriter(docenv);
|
||||||
if (this.title != null)
|
if (this.title != null)
|
||||||
mdwriter.setTitle(this.title);
|
mdwriter.setTitle(this.title);
|
||||||
if (this.apiName != null)
|
if (this.apiName != null)
|
||||||
@ -193,17 +186,4 @@ public class ActivitiDoclet implements Doclet {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private abstract class PathOption extends ValueOption {
|
|
||||||
|
|
||||||
public PathOption(String name, String description, Kind kind, String... additionalNames) {
|
|
||||||
super(name, description, kind, additionalNames);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getParameters() {
|
|
||||||
return "<dir>";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,15 +61,9 @@ class MarkdownWriter {
|
|||||||
private String apiName;
|
private String apiName;
|
||||||
private String flavor;
|
private String flavor;
|
||||||
|
|
||||||
public MarkdownWriter(DocletEnvironment docenv, String outputDirectory) throws IOException {
|
public MarkdownWriter(DocletEnvironment docenv) throws IOException {
|
||||||
this.docenv = docenv;
|
this.docenv = docenv;
|
||||||
this.outputDirectory = (outputDirectory == null || outputDirectory.trim().length() == 0) ? new File(".") : new File(outputDirectory);
|
this.outputDirectory = new File(".");
|
||||||
this.fmconfig = this.getFreemarkerConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
public MarkdownWriter(DocletEnvironment docenv, File outputDirectory) throws IOException {
|
|
||||||
this.docenv = docenv;
|
|
||||||
this.outputDirectory = outputDirectory == null ? new File(".") : outputDirectory;
|
|
||||||
this.fmconfig = this.getFreemarkerConfiguration();
|
this.fmconfig = this.getFreemarkerConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +105,6 @@ class MarkdownWriter {
|
|||||||
this.logger.debug("Building documentation index model");
|
this.logger.debug("Building documentation index model");
|
||||||
|
|
||||||
IndexFreemarkerModel indexModel = new IndexFreemarkerModel();
|
IndexFreemarkerModel indexModel = new IndexFreemarkerModel();
|
||||||
System.out.println("title: " + this.title);
|
|
||||||
indexModel.setTitle(this.title);
|
indexModel.setTitle(this.title);
|
||||||
indexModel.setApiName(this.apiName);
|
indexModel.setApiName(this.apiName);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user