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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract List<T> get(Project project)
      abstract Unit register(Project project, T extension)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • register

         abstract Unit register(Project project, T extension)
        Parameters:
        project - The current project to register an extension.
        extension - The implementation of the extension to register.