Installation
Requirements
- Kotlin 2.2.20 through 2.4.20
- Kotlin 2.3.0 or later on iOS and other native targets, see iOS / Native ABI Compatibility
Gradle Setup
Apply the plugin. It adds aspectk-runtime to your project.
Using Version Catalog (recommended)
Add to gradle/libs.versions.toml:
[versions]
aspectk = "LATEST_VERSION"
[plugins]
aspectk = { id = "io.github.mole-labs.aspectk", version.ref = "aspectk" }
Then in your build.gradle.kts:
Note
aspectk-runtime is added as an implementation dependency. You don't need to declare
it in any source set.
Kotlin Version Compatibility
| AspectK Version | Supported Kotlin Range |
|---|---|
| 0.3.0 ~ 0.4.0 | 2.2.20 ~ 2.4.10 |
| 0.4.1 ~ 0.4.4 | 2.2.20 ~ 2.4.20 |
Note
AspectK uses the K2 compiler IR API, so each release supports a fixed Kotlin range. Check the compatibility table before upgrading either one.