This repository contains a Kotlin Compiler Plugin that automagically adds method tracing (to stdout) to any function annotated with a user-specified "DebugLog" annotation.
Currently, there are many bugs in this code, as it was a toy project made specifically for a talk I gave on Kotlin Compiler plugins at KotlinConf (video here, slides here, talk abstract here).
Build the artifacts for both the :gradle-plugin
and :kotlin-plugin
modules, and publish them to a Maven repo.
Add a dependency on the :gradle-plugin
artifact to your root build.gradle
:
buildscript {
dependencies {
classpath "debuglog:gradle-plugin:0.0.1"
}
}
and then in your module-specific build.gradle
, apply/configure the plugin:
apply plugin: "debuglog.plugin"
debugLog {
enabled = true
annotations = [ "com.sample.myapp.annotations.DebugLog" ]
}
You tell me!