Initial commit (split from bld-kotlin)
Some checks failed
bld-ci / build-bld-project (17) (push) Has been cancelled
bld-ci / build-bld-project (21) (push) Has been cancelled
bld-ci / build-bld-project (22) (push) Has been cancelled
javadocs-pages / deploy (push) Has been cancelled

This commit is contained in:
Erik C. Thauvin 2024-06-15 16:36:35 -07:00
commit a46ed2c012
Signed by: erik
GPG key ID: 776702A6A2DA330E
67 changed files with 3428 additions and 0 deletions

80
README.md Normal file
View file

@ -0,0 +1,80 @@
# [bld](https://rife2.com/bld) Extension to Generate API Documentation with [Dokka](https://github.com/Kotlin/dokka) for [Kotlin](https://kotlinlang.org/)
[![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![bld](https://img.shields.io/badge/1.9.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![Release](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/releases/com/uwyn/rife2/bld-dokka/maven-metadata.xml?color=blue)](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-dokka)
[![Snapshot](https://flat.badgen.net/maven/v/metadata-url/repo.rife2.com/snapshots/com/uwyn/rife2/bld-dokka/maven-metadata.xml?label=snapshot)](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-dokka)
[![GitHub CI](https://github.com/rife2/bld-dokka/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-dokka/actions/workflows/bld.yml)
To install, please refer to the [extensions](https://github.com/rife2/bld/wiki/Extensions) and [support](https://github.com/rife2/bld/wiki/Kotlin-Support)
documentation.
## Generate API Documentation
To generate a project's documentation in various formats:
```java
@BuildCommand(value = "dokka-gfm", summary = "Generates documentation in GitHub flavored markdown format")
public void dokkaGfm() throws ExitStatusException, IOException, InterruptedException {
new DokkaOperation()
.fromProject(this)
.loggingLevel(LoggingLevel.INFO)
// Create build/dokka/gfm
.outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "gfm").toFile())
.outputFormat(OutputFormat.MARKDOWN)
.execute();
}
@BuildCommand(value = "dokka-html", summary = "Generates documentation in HTML format")
public void dokkaHtml() throws ExitStatusException, IOException, InterruptedException {
new DokkaOperation()
.fromProject(this)
.loggingLevel(LoggingLevel.INFO)
// Create build/dokka/html
.outputDir(Path.of(buildDirectory().getAbsolutePath(), "dokka", "html").toFile())
.outputFormat(OutputFormat.HTML)
.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 {
new DokkaOperation()
.fromProject(this)
.failOnWarning(true)
.loggingLevel(LoggingLevel.INFO)
// Create build/javadoc
.outputDir(new File(buildDirectory(), "javadoc"))
.outputFormat(OutputFormat.JAVADOC)
.execute();
}
```
```console
./bld javadoc
./bld dokka-html
./bld dokka-gfm
./bld dokka-jekyll
```
- [View Examples Project](https://github.com/rife2/bld-dokka/tree/main/examples/)
Please check the [Dokka Operation documentation](https://rife2.github.io/bld-dokka/rife/bld/extension/DokkaOperation.html#method-summary)
for all available configuration options.
## Template Project
There is also a [Kotlin Template Project](https://github.com/rife2/kotlin-bld-example) with support for Dokka and the
[Detekt](https://github.com/rife2/bld-detekt) extensions.