aboutsummaryrefslogtreecommitdiff
path: root/build-src/src/main/kotlin/helpers.kt
blob: 5afef4f857cada3b4380dee05bd051c2eaf3510d (plain)
1
2
3
4
5
6
7
8
9
10
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.findByType


inline fun <reified T : Any> ExtensionAware.configureIf(crossinline block: T.() -> Unit) {
	if (extensions.findByType<T>() != null) {
		extensions.configure<T> { block() }
	}
}