Configuration
All JNI settings are nested under platform.jvm.jni inside the kreate { } block.
Minimal Setup
With only enabled = true, Kreate resolves all other values from the project configuration automatically.
Full Configuration
DSL Reference
Property | Type | Default | Description |
|---|---|---|---|
|
|
| Enables the JNI feature and registers all related tasks |
|
| (project name) | Overrides the native project name used for CMake target and directory resolution |
|
|
| Root directory that contains the native project folder |
|
| (empty) | Additional C++ library include directories passed to the compiler via CMake |
enabled
Controls whether the entire JNI feature is active. When false (the default), no tasks are registered and no build pipeline changes are applied.
nameOverride
By default, Kreate derives the native project name from project.name in kreate { project { name = ... } }, falling back to the Gradle project name. The resolved name is sanitized before use. Use nameOverride when you need a specific CMake target name that differs from the Kotlin project name.
projectDirectory
Overrides the root directory where Kreate looks for (and creates) the native project folder. The actual native project lives at <projectDirectory>/<projectName>/.
libraryIncludePaths
Declares additional C++ library include directories that are passed to the compiler. This is useful when the native project depends on multiple external libraries located in different directories. Each configured path is added to the generated CMakeLists.txt via target_include_directories, alongside the conventional include directory and the JNI headers. Paths may be absolute or relative to the native project root (<projectDirectory>/<projectName>/).