Skip to content

Kotlin compiler

Zeioth edited this page Aug 28, 2023 · 18 revisions

Available options

Here I explain what every option of the compiler does for Kotlin.

screenshot_2023-08-27_14-38-26_009440025

compiler option description
1 - Build and run program Generates a class per file in ./bin and run ./bin/MainKt.class
2 - Build program Generates a class per file in ./bin
3 - Build program and package as .jar Generates ./bin/MainKt.jar. Use it when you want to distribute your application.
4 - Run program Runs ./bin/MainKt.jar
5 - Build solution Read the wiki to know how solutions work. You can find a Kotlin example .solution.toml here.
6 - Android studio build and install apk (adb) Uses adb to build and install the apk in your android smartphone. Note this will only work if adb is properly configured.
7 - Android studio build and install apk Generate apk in your computer.
8 - Run REPL Run the kotlin REPL

Using a virtual machine

You can leverage .solution.toml to generate a APK and run it on a virtual machine when working with an Android Studio project.

This section is currenly WIP

Working with Android Studio projects

Android studio projects don't have a deterministic entry point. This mean for real world projects you will have to create a .solution.toml file in your project root directory. You can find a example here

Working with Maven/Grapl packages

Same as the former.