https://github.com/davils-com/kreate
A helper plugin for setting up enterprise-grade Gradle Kotlin projects.
https://github.com/davils-com/kreate
cinterop constants gradle jvm maven multiplatform publishing rust setup testing
Last synced: about 1 month ago
JSON representation
A helper plugin for setting up enterprise-grade Gradle Kotlin projects.
- Host: GitHub
- URL: https://github.com/davils-com/kreate
- Owner: davils-com
- License: apache-2.0
- Created: 2026-04-08T19:12:19.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-26T12:08:34.000Z (about 1 month ago)
- Last Synced: 2026-04-26T14:00:39.520Z (about 1 month ago)
- Topics: cinterop, constants, gradle, jvm, maven, multiplatform, publishing, rust, setup, testing
- Language: Kotlin
- Homepage: https://davils-com.github.io/kreate/
- Size: 487 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
๐๏ธ Kreate
Kreate is an opinionated Gradle helper plugin for building Kotlin Multiplatform (KMP) and JVM projects.
It provides a unified DSL to manage platform configurations, native C-Interop (Rust), JNI, documentation, testing, and publishing workflows with minimal boilerplate.
---
## ๐ Table of Contents
- [Overview](#-overview)
- [Core Features](#-core-features)
- [Quick Start](#-quick-start)
- [Configuration Reference](#-configuration-reference)
- [Documentation](#-documentation)
- [Third-Party Software](#-third-party-software)
- [Contributing](#-contributing)
- [License & Ethics](#-license--ethics)
---
## ๐ Overview
Managing Kotlin Multiplatform and JVM configurations can be complex. **Kreate** simplifies this by:
* **Standardizing Platform Setup**: A consistent DSL for JVM, Linux, macOS, and Windows.
* **Integrating Native Code**: Automated bridge for Rust (via C-Interop) and C/C++ (via JNI).
* **Enforcing Quality Standards**: Sensible defaults like `explicitApi()` and `allWarningsAsErrors`.
* **Declarative Infrastructure**: Focus on project requirements while the plugin handles the underlying Gradle configuration.
---
## โจ Core Features
### ๐๏ธ Platform Support
Kreate detects the project type (JVM, Android, or KMP) and applies appropriate optimizations:
- **JVM Support**: Configures Java 21+ toolchains and compiler options.
- **Multiplatform DSL**: Unified targets for Linux, macOS, and Windows.
- **Consistent Toolchains**: Ensures Java and Kotlin versions are synchronized across modules.
### ๐ฆ Rust C-Interop
Automates the integration of Rust libraries into Kotlin Multiplatform:
- **Toolchain Integration**: Manages `cargo` and cross-compilation targets.
- **Project Scaffolding**: Can generate Rust library structures if missing.
- **Header Synchronization**: Manages C headers and Kotlin bindings.
- **Multi-Arch Support**: Targets `x86_64`, `aarch64`, and others.
### ๐ JNI Support (Java Native Interface)
Simplified integration for native C/C++ code in JVM projects:
- **CMake Integration**: Automatically handles CMake-based native builds.
- **Runtime Library Path**: Automatically configures `java.library.path` for testing and execution.
- **Consistent Layout**: Follows a structured layout for native sources (mirroring C-Interop style).
### ๐งช Testing Pipeline
Pre-configured **Kotest** integration for robust validation:
- **Parallel Execution**: Scales based on CPU availability.
- **Standardized Logging**: Clear output for test states (Passed, Skipped, Started).
- **Automated Reporting**: Generates HTML and XML reports for CI/CD.
### ๐ฆ Publishing & POM Management
Standardizes the release process for libraries:
- **Registry Support**: Built-in configurations for Maven Central and GitLab.
- **Signing**: Integrated GPG signing for Maven Central requirements.
- **POM Metadata**: Declarative DSL for licenses, developers, and SCM information.
---
## ๐ Documentation
Detailed documentation for Kreate is available in the following locations:
- **[Project Docs](./docs)**: Comprehensive guides and topic-specific information.
- **[API Reference](https://davils.github.io/kreate/api)**: Dokka-generated API documentation.
- **[Examples](./example)**: A reference implementation demonstrating various configuration scenarios.
To generate the documentation locally, run:
```bash
./gradlew dokkaHtml
```
---
## ๐ ๏ธ Quick Start
### Installation
Add the plugin to your `settings.gradle.kts` (recommended) or `build.gradle.kts`:
```kotlin
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id("com.davils.kreate") version ""
}
```
### Configuration
Apply the plugin in your `build.gradle.kts`:
```kotlin
kreate {
platform {
javaVersion = JavaVersion.VERSION_25
explicitApi = true
jvm {
jni {
enabled = true
// Optional: projectDirectory = file("custom-jni-path")
}
}
multiplatform {
cInterop {
enabled = true
rustTargets = listOf("x86_64-unknown-linux-gnu", "aarch64-apple-darwin")
}
}
}
project {
name = "MyProject"
description = "A project powered by Kreate"
publish {
enabled = true
repositories {
mavenCentral {
enabled = true
automaticRelease = true
}
}
}
}
}
```
---
## โ๏ธ Configuration Reference
| Block | Property | Description | Default |
|:-----------|:----------------------|:------------------------------------------|:-------------|
| `platform` | `javaVersion` | Target Java version (21, 25, etc.) | `VERSION_21` |
| `platform` | `explicitApi` | Enforces Kotlin Explicit API mode | `false` |
| `platform` | `allWarningsAsErrors` | Treats all compiler warnings as errors | `true` |
| `jvm.jni` | `enabled` | Enables JNI support (CMake-based) | `false` |
| `project` | `buildConstant` | Generate type-safe Kotlin constants | `Disabled` |
| `project` | `docs` | Configure Dokka documentation generation | `Disabled` |
| `project` | `tests` | Advanced Kotest configuration & reporting | `Enabled` |
| `project` | `publish` | Maven Central / GitLab publishing setup | `Disabled` |
---
## ๐ฆ Third-Party Software
Kreate leverages various open-source technologies. For a full list of libraries and licenses, please refer to the [Third-Party Software](./THIRDPARTY.md) document.
---
## ๐ค Contributing
We welcome all contributions! To maintain quality, please note:
- **Documentation**: Changes to API or behavior must be documented.
- **Tests**: Ensure your changes are covered by tests.
- **Standards**: Follow the established Kotlin style and project conventions.
Detailed instructions can be found in our [Contributing Guidelines](CONTRIBUTING.md).
---
## โ๏ธ License & Ethics
- **License**: Published under the **Apache License 2.0**. See `LICENSE` for details.
- **Code of Conduct**: We adhere to our [Code of Conduct](CODE_OF_CONDUCT.md).
---
Maintained by Davils