Skip to content

rife2/bld-kotlin

Repository files navigation

Kotlin Extension for bld

License Java Kotlin bld Release Snapshot GitHub CI

To install, please refer to the extensions and support documentation.

Compile Kotlin Source Code

To compile the source code located in src/main/kotlin and src/test/kotlin from the current project:

@BuildCommand(summary = "Compiles the Kotlin project")
public void compile() throws IOException {
    new CompileKotlinOperation()
            .fromProject(this)
            .execute();
}
./bld compile

Please check the Compile Operation documentation for all available configuration options.

Generate Javadoc

To generate the Javadoc using Dokka:

@BuildCommand(summary = "Generates Javadoc for the project")
public void javadoc() throws ExitStatusException, IOException, InterruptedException {
    new DokkaOperation()
            .fromProject(this)
            .outputDir(new File(buildDirectory(), "javadoc"))
            .outputFormat(OutputFormat.JAVADOC)
            .execute();
}
./bld javadoc

Please check the Dokka Operation documentation for all available configuration options.

Template Project

There is also a Template Project with support for Dokka and the Detekt extensions.