api / org.gradle.kotlin.dsl / org.gradle.api.plugins.Convention / getPluginByName

getPluginByName

inline fun <reified T : Any> Convention.getPluginByName(name: String): T

Looks for the convention plugin of a given name and casts it to the expected type T.

If no convention is found or if the one found cannot be cast to the expected type it will throw an IllegalStateException.

Parameters

name - convention plugin name

Exceptions

IllegalStateException - When the convention cannot be found or cast to the expected type.

Return
the convention plugin, never null