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>
|
||||
<groupId>com.inteligr8.activiti</groupId>
|
||||
<artifactId>activiti-api-doclet</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1</version>
|
||||
</docletArtifact>
|
||||
<useStandardDocletOptions>false</useStandardDocletOptions>
|
||||
<destDir>destDir</destDir>
|
||||
<destDir>apidocs</destDir>
|
||||
<reportOutputDirectory>${basedir}</reportOutputDirectory>
|
||||
<additionalOptions>
|
||||
<additionalOption>-d d</additionalOption>
|
||||
<additionalOption>--flavor bitbucket</additionalOption>
|
||||
<additionalOption>--title 'API Documentation'</additionalOption>
|
||||
<additionalOption>--apiName '${project.name}</additionalOption>
|
||||
@ -46,4 +46,4 @@ You can generate the docs with the following command:
|
||||
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>
|
||||
</docletArtifact>
|
||||
<useStandardDocletOptions>false</useStandardDocletOptions>
|
||||
<destDir>destDir</destDir>
|
||||
<destDir>apidocs</destDir>
|
||||
<reportOutputDirectory>${basedir}</reportOutputDirectory>
|
||||
<additionalOptions>
|
||||
<additionalOption>-d d</additionalOption>
|
||||
<additionalOption>--flavor bitbucket</additionalOption>
|
||||
<additionalOption>--title 'Example Title'</additionalOption>
|
||||
<additionalOption>--apiName '${project.name}'</additionalOption>
|
||||
</additionalOptions>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -44,7 +44,7 @@ import jdk.javadoc.doclet.Reporter;
|
||||
public class ActivitiDoclet implements Doclet {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
private String outputDirectory;
|
||||
|
||||
private String flavor;
|
||||
private String title;
|
||||
private String apiName;
|
||||
@ -57,13 +57,6 @@ public class ActivitiDoclet implements Doclet {
|
||||
@Override
|
||||
public Set<? extends Option> getSupportedOptions() {
|
||||
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) {
|
||||
@Override
|
||||
public boolean process(String name, List<String> valueAndClasses) {
|
||||
@ -122,7 +115,7 @@ public class ActivitiDoclet implements Doclet {
|
||||
List<ActivitiApiBeanDoc> beandocs = docfilter.build();
|
||||
|
||||
try {
|
||||
MarkdownWriter mdwriter = new MarkdownWriter(docenv, this.outputDirectory);
|
||||
MarkdownWriter mdwriter = new MarkdownWriter(docenv);
|
||||
if (this.title != null)
|
||||
mdwriter.setTitle(this.title);
|
||||
if (this.apiName != null)
|
||||
@ -192,18 +185,5 @@ 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 flavor;
|
||||
|
||||
public MarkdownWriter(DocletEnvironment docenv, String outputDirectory) throws IOException {
|
||||
public MarkdownWriter(DocletEnvironment docenv) throws IOException {
|
||||
this.docenv = docenv;
|
||||
this.outputDirectory = (outputDirectory == null || outputDirectory.trim().length() == 0) ? new File(".") : new File(outputDirectory);
|
||||
this.fmconfig = this.getFreemarkerConfiguration();
|
||||
}
|
||||
|
||||
public MarkdownWriter(DocletEnvironment docenv, File outputDirectory) throws IOException {
|
||||
this.docenv = docenv;
|
||||
this.outputDirectory = outputDirectory == null ? new File(".") : outputDirectory;
|
||||
this.outputDirectory = new File(".");
|
||||
this.fmconfig = this.getFreemarkerConfiguration();
|
||||
}
|
||||
|
||||
@ -111,7 +105,6 @@ class MarkdownWriter {
|
||||
this.logger.debug("Building documentation index model");
|
||||
|
||||
IndexFreemarkerModel indexModel = new IndexFreemarkerModel();
|
||||
System.out.println("title: " + this.title);
|
||||
indexModel.setTitle(this.title);
|
||||
indexModel.setApiName(this.apiName);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user