Interface KotlinGradlePluginExtensionPoint
-
- All Implemented Interfaces:
public interface KotlinGradlePluginExtensionPoint<T extends Object>
Note: Not stable for implementation: Custom implementations of this interface will not be supported by the Kotlin Gradle Plugin!
This KotlinGradlePluginExtensionPoint will be used to 'generically' extend parts of the Kotlin Gradle Plugin (internally and externally). General Kotlin Gradle Plugin code will call into this 'semantically' structured extension points to load logic Such extension points are to be used for public as well as for internal extension points.
Extension Points are to be declared on companion objects on the corresponding interface
interface MyKotlinGradlePluginExtension { fun foo(project: Project) companion object { val extensionPoint = KotlinExtensionPoint<MyKotlinGradlePluginExtension>() } }
Extension Points are scoped by Project and should be registered as early as possible
class MyPlugin: Plugin<Project> { fun apply(project: Project) { MyKotlinGradlePluginExtension.extensionPoint.register(project, MyKotlinGradlePluginExtensionImpl()) } }
Extensions registered by the Kotlin Gradle Plugin directly will use the org.jetbrains.kotlin.gradle.plugin.registerKotlinPluginExtensions entry point.