Added support for the Dokka Jekyll plugin

This commit is contained in:
Erik C. Thauvin 2023-11-08 22:44:50 -08:00
parent 51d046a2f7
commit 23255460e3
5 changed files with 18 additions and 1 deletions

View file

@ -5,6 +5,7 @@
<pattern value="com.example.ExampleBuild" method="javadoc" />
<pattern value="com.example.ExampleBuild" method="dokkaHtml" />
<pattern value="com.example.ExampleBuild" method="dokkaGfm" />
<pattern value="com.example.ExampleBuild" method="dokkaJekyll" />
</component>
<component name="PDMPlugin">
<option name="customRuleSets">

View file

@ -94,6 +94,17 @@ public class ExampleBuild extends Project {
.execute();
}
@BuildCommand(value = "dokka-jekyll", summary = "Generates documentation in Jekyll flavored markdown format")
public void dokkaJekyll() throws ExitStatusException, IOException, InterruptedException {
new DokkaOperation()
.fromProject(this)
.loggingLevel(LoggingLevel.INFO)
// Create build/dokka/jekyll
.outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "jekkyl").toFile())
.outputFormat(OutputFormat.JEKYLL)
.execute();
}
@BuildCommand(summary = "Generates Javadoc for the project")
@Override
public void javadoc() throws ExitStatusException, IOException, InterruptedException {

View file

@ -48,6 +48,7 @@ public class CompileKotlinOperationBuild extends Project {
.include(dependency("org.jetbrains.dokka", "analysis-kotlin-descriptors", dokka))
.include(dependency("org.jetbrains.dokka", "javadoc-plugin", dokka))
.include(dependency("org.jetbrains.dokka", "gfm-plugin", dokka))
.include(dependency("org.jetbrains.dokka", "jekyll-plugin", dokka))
.include(dependency("com.uwyn.rife2", "bld", version(1, 7, 5)));
scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1)))

View file

@ -40,6 +40,8 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
"^.*(dokka-base|analysis-kotlin-descriptors|kotlinx-html-jvm|freemarker).*\\.jar$";
private final static String JAVADOC_PLUGIN_REGEXP =
"^.*(dokka-base|analysis-kotlin-descriptors|javadoc-plugin|kotlin-as-java-plugin|korte-jvm).*\\.jar$";
private final static String JEKYLL_PLUGIN_REGEXP =
"^.*(dokka-base|analysis-kotlin-descriptors|jekyll-plugin|gfm-plugin|freemarker).*\\.jar$";
private final Logger LOGGER = Logger.getLogger(DokkaOperation.class.getName());
private final Map<String, String> globalLinks_ = new ConcurrentHashMap<>();
private final Collection<String> globalPackageOptions_ = new ArrayList<>();
@ -452,6 +454,8 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
pluginsClasspath_.addAll(getJarList(project_.libBldDirectory(), HTML_PLUGIN_REGEXP));
} else if (format.equals(OutputFormat.MARKDOWN)) {
pluginsClasspath_.addAll(getJarList(project_.libBldDirectory(), GFM_PLUGIN_REGEXP));
} else if (format.equals(OutputFormat.JEKYLL)) {
pluginsClasspath_.addAll(getJarList(project_.libBldDirectory(), JEKYLL_PLUGIN_REGEXP));
}
return this;
}

View file

@ -23,5 +23,5 @@ package rife.bld.extension.dokka;
* @since 1.0
*/
public enum OutputFormat {
JAVADOC, HTML, MARKDOWN
JAVADOC, JEKYLL, HTML, MARKDOWN
}