Hey all!
I got tired of writing BaseActivity and BaseViewModel every time I needed to share logging or screen-specific logic. No matter how I tried — delegation,
trailing lambdas — cross-cutting concerns always ended up tangled with my business code.
Inspired by
AspectJ and
Spring AOP, I built AspectK — an AOP library designed for
Kotlin Multiplatform.
Just annotate a method, and AspectK intercepts its parameters to handle cross-cutting concerns completely separately from your business logic.
How it works:
AspectK is implemented as a Kotlin Compiler Plugin that manipulates Kotlin IR directly. Because the code injection happens before the Lowering phase, it works
on suspend and inline functions with virtually zero runtime overhead.
GitHub:
https://github.com/Mole-Labs/aspectk
Feedback and contributions are always welcome!