Building with Electron
KVision allows you to develop cross-platform (Windows, Linux and Mac), desktop applications with the full power of Electron framework. You can use all KVision components in your desktop applications, and the kvision-electron module gives you a complete set of Kotlin language bindings for Electron API.
Setting up
The easiest way to start is to clone template-electron
project from kvision-examples repository on GitHub. It contains the basic configuration for building, running and bundling your application. To run your application during the development call:
It will open an Electron window with your application running inside.
To bundle your application call:
It will create packed and unpacked app in the build/electron
directory.
Configuring Electron builder
The application is build with electron-builder tool. The configuration is contained in the src/main/electron/electron-builder.yml
configuration file. You can find documentation of electron-builder here. By default the application is built for the current platform only. Cross-platform build (e.g. for Windows on Linux host) is sometimes possible, but there are some additional requirements.
Using NodeJS and Electron API
To use NodeJS and Electron API in your application, you have to add kvision-electron module to your build.gradle.kts
dependencies. NodeJS Kotlin bindings are provided by node-kt project (package node.*
) and Electron bindings are provided directly by KVision module (package pl.treksoft.kvision.electron.*
).
Last updated