Skip to content

Commit 2325546

Browse files
committed
Added support for the Dokka Jekyll plugin
1 parent 51d046a commit 2325546

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

examples/.idea/misc.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/src/bld/java/com/example/ExampleBuild.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ public void dokkaHtml() throws ExitStatusException, IOException, InterruptedExce
9494
.execute();
9595
}
9696

97+
@BuildCommand(value = "dokka-jekyll", summary = "Generates documentation in Jekyll flavored markdown format")
98+
public void dokkaJekyll() throws ExitStatusException, IOException, InterruptedException {
99+
new DokkaOperation()
100+
.fromProject(this)
101+
.loggingLevel(LoggingLevel.INFO)
102+
// Create build/dokka/jekyll
103+
.outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "jekkyl").toFile())
104+
.outputFormat(OutputFormat.JEKYLL)
105+
.execute();
106+
}
107+
97108
@BuildCommand(summary = "Generates Javadoc for the project")
98109
@Override
99110
public void javadoc() throws ExitStatusException, IOException, InterruptedException {

src/bld/java/rife/bld/extension/CompileKotlinOperationBuild.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public CompileKotlinOperationBuild() {
4848
.include(dependency("org.jetbrains.dokka", "analysis-kotlin-descriptors", dokka))
4949
.include(dependency("org.jetbrains.dokka", "javadoc-plugin", dokka))
5050
.include(dependency("org.jetbrains.dokka", "gfm-plugin", dokka))
51+
.include(dependency("org.jetbrains.dokka", "jekyll-plugin", dokka))
5152
.include(dependency("com.uwyn.rife2", "bld", version(1, 7, 5)));
5253
scope(test)
5354
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 1)))

src/main/java/rife/bld/extension/dokka/DokkaOperation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
4040
"^.*(dokka-base|analysis-kotlin-descriptors|kotlinx-html-jvm|freemarker).*\\.jar$";
4141
private final static String JAVADOC_PLUGIN_REGEXP =
4242
"^.*(dokka-base|analysis-kotlin-descriptors|javadoc-plugin|kotlin-as-java-plugin|korte-jvm).*\\.jar$";
43+
private final static String JEKYLL_PLUGIN_REGEXP =
44+
"^.*(dokka-base|analysis-kotlin-descriptors|jekyll-plugin|gfm-plugin|freemarker).*\\.jar$";
4345
private final Logger LOGGER = Logger.getLogger(DokkaOperation.class.getName());
4446
private final Map<String, String> globalLinks_ = new ConcurrentHashMap<>();
4547
private final Collection<String> globalPackageOptions_ = new ArrayList<>();
@@ -452,6 +454,8 @@ public DokkaOperation outputFormat(OutputFormat format) {
452454
pluginsClasspath_.addAll(getJarList(project_.libBldDirectory(), HTML_PLUGIN_REGEXP));
453455
} else if (format.equals(OutputFormat.MARKDOWN)) {
454456
pluginsClasspath_.addAll(getJarList(project_.libBldDirectory(), GFM_PLUGIN_REGEXP));
457+
} else if (format.equals(OutputFormat.JEKYLL)) {
458+
pluginsClasspath_.addAll(getJarList(project_.libBldDirectory(), JEKYLL_PLUGIN_REGEXP));
455459
}
456460
return this;
457461
}

src/main/java/rife/bld/extension/dokka/OutputFormat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
* @since 1.0
2424
*/
2525
public enum OutputFormat {
26-
JAVADOC, HTML, MARKDOWN
26+
JAVADOC, JEKYLL, HTML, MARKDOWN
2727
}

0 commit comments

Comments
 (0)