aboutsummaryrefslogtreecommitdiff
path: root/build-src/src/main/kotlin/helpers.kt
diff options
context:
space:
mode:
Diffstat (limited to 'build-src/src/main/kotlin/helpers.kt')
-rw-r--r--build-src/src/main/kotlin/helpers.kt10
1 files changed, 10 insertions, 0 deletions
diff --git a/build-src/src/main/kotlin/helpers.kt b/build-src/src/main/kotlin/helpers.kt
new file mode 100644
index 0000000..5afef4f
--- /dev/null
+++ b/build-src/src/main/kotlin/helpers.kt
@@ -0,0 +1,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() }
+ }
+}