rife2 / bld-kotlin

Kotlin Extension for bld

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 Exception {
    new CompileKotlinOperation()
            .fromProject(this)
            .execute();
}
./bld compile

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

Kotlin Compiler Requirement

Please make sure the Kotlin compiler is installed.

You can also manually configure the Kotlin home location as follows:

@BuildCommand(summary = "Compiles the Kotlin project")
public void compile() throws Exception {
    new CompileKotlinOperation()
            .fromProject(this)
            .kotlinHome("path/to/kotlin")
            .execute();
}

The Kotlin compiler executable can also be specified directly:

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

While older version of Kotlin are likely working with the extension, only version 1.9.24 or higher are officially supported.

Template Project

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

About

Kotlin Extension for bld

License:Apache License 2.0


Languages

Language:Java 99.0%Language:Shell 0.7%Language:Batchfile 0.3%