Skip to main content

Getting Started

Kanvas targets Gradle-based Kotlin/JVM desktop applications.

Recommended path

For normal application development, use the published org.yurie.kanvas plugin and let Kanvas provision its matching runtime. The included-build setup later on this page is primarily for Kanvas development.

Requirements​

Typical host requirements:

  • JDK 17+
  • Gradle or a Gradle wrapper
  • Git
  • CMake 3.21+
  • Ninja or Make
  • a native compiler/toolchain
  • graphics/runtime libraries required by the selected backend

On macOS, install Xcode Command Line Tools:

xcode-select --install

Apply the plugin​

Kanvas 0.1.0 uses the plugin ID:

plugins {
id("org.yurie.kanvas") version "0.1.0"
}

For a multi-module project, select the module that owns the desktop application:

kanvas {
target = ":desktop"
backend = "auto"
}

For an application in the root project:

kanvas {
target = ":"
}

Check the project​

Before debugging renderer behavior, run:

./gradlew kanvasDoctor
./gradlew kanvasCompatibility
Fix Doctor errors first

Treat every Doctor ERROR as a blocker. A WARN means Kanvas found something unverified or non-ideal, not necessarily something that prevents startup.

Build and run​

./gradlew kanvasBuild
./gradlew kanvasRun

For a Compose Desktop distributable:

./gradlew kanvasPackage
Pre-release packaging

Always test the generated distributable on the same operating system and architecture you intend to ship. Packaging support is functional, but broad platform verification is still in progress.

Backend selection​

The default is:

kanvas {
backend = "auto"
}

Available backend names:

auto
vulkan
metal
opengl
d3d9
gdi

Not every backend is available on every operating system. See Backends.

Development checkout​

When working directly from the Kanvas source tree before using a published plugin artifact, the project can also be included as a plugin build.

pluginManagement {
includeBuild("../Kanvas/gradle-plugin")
}

Then apply:

plugins {
id("org.yurie.kanvas")
}

The published plugin form is preferred for normal users.