inline fun <ConventionType : Any, ReturnType> Any.withConvention(conventionType: KClass<ConventionType>, function: ConventionType.() -> ReturnType): ReturnType
Evaluates the given function against the convention plugin of the given conventionType.
conventionType
- the type of the convention to be located.
function
- function to be evaluated.
IllegalStateException
- When the receiver does not support convention plugins, when there is no convention plugin of the given type, or when there are multiple such plugins.
Return
the value returned by the given function.
See Also