Creating a New Application
Creating a new application
To create a new application just copy the template project and modify it by adding modules.
gradle/libs.versions.toml
The template uses Gradle version catalog. All plugins and dependencies are listed in the gradle/libs.versions.toml
file.
build.gradle.kts
The build.gradle.kts
file is responsible for the definition of the build process. It declares all required dependencies (in particular Kilua optional modules). Kilua Gradle plugin is used to simplify the configuration.
Source code
As Kilua apps can be compiled to both Kotlin/Js and Kotlin/WasmJs targets, the source code for the application is contained in the src/commonMain
directory. It consists of Kotlin sources in the kotlin
directory and the resources
directory with main index.html
file and optional assets (e.g. images, CSS files, translation files).
Test sources are contained in the src/commonTest
directory.
When creating fullstack or SSR apps with additional JVM target, the common
source set can't be used for the fronted code. It is recommended to create a custom, shared webMain
source set.
The Application class
The main Kilua application class must extend the dev.kilua.Application
class and override thestart
method.
Last updated