Skip to content

Installation

Maven Central

Requirements

Gradle Setup

Apply the plugin. It adds aspectk-runtime to your project.

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:

plugins {
    alias(libs.plugins.aspectk)
}

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.