milis92 / Krang

Kotlin Compiler Plugin that gives you the ability to be notified every time annotated function is called
Apache License 2.0
35 stars 1 forks source link

Variant filters #33

Closed milis92 closed 1 year ago

milis92 commented 1 year ago

This PR aims to provide the ability for krang to be differently configured based on the kotlin compilation.

Example usage would be

krang {
    enabled.set(true)
    godMode.set(true)

    variantFilter {
        val kotlinCompilation: KotlinCompilation<*> = this
        when (kotlinCompilation) {
            is KotlinJvmAndroidCompilation -> {
                if (kotlinCompilation.androidVariant.buildType.name == "release") {
                    enabled.set(false)
                }
            }
        }
    }
}