bld-kotlin/README.md

2.6 KiB

Kotlin Extension for bld

License Java Kotlin bld Release Snapshot GitHub CI

To install, please refer to the extensions 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 = "Compile the Kotlin project")
public void compile() throws IOException {
    new CompileKotlinOperation()
            .fromProject(this)
            .compileOptions(new CompileKotlinOptions().verbose(true))
            .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.