import org.gradle.api.Project inline fun Project.configureIfExists(fn: T.() -> Unit) { extensions.findByType(T::class.java)?.fn() }