api / org.gradle.plugin.devel / GradlePluginDevelopmentExtension

GradlePluginDevelopmentExtension

@Incubating open class GradlePluginDevelopmentExtension

Configuration options for the org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin.

Below is a full configuration example. Since all properties have sensible defaults, typically only selected properties will be configured.

 apply plugin: "java-gradle-plugin" gradlePlugin { pluginSourceSet project.sourceSets.customMain testSourceSets project.sourceSets.functionalTest plugins { helloPlugin { id = 'org.example.hello' implementationClass = 'org.example.HelloPlugin' } } } 

See Also
org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin

Since
2.13

Constructors

<init>

GradlePluginDevelopmentExtension(project: Project, pluginSourceSet: SourceSet, testSourceSet: SourceSet)
GradlePluginDevelopmentExtension(project: Project, pluginSourceSet: SourceSet, testSourceSets: Array<SourceSet>)

Functions

getPluginSourceSet

open fun getPluginSourceSet(): SourceSet

Returns the source set that compiles the code under test. Defaults to project.sourceSets.main.

getPlugins

open fun getPlugins(): NamedDomainObjectContainer<PluginDeclaration>

Returns the declared plugins.

getTestSourceSets

open fun getTestSourceSets(): MutableSet<SourceSet>

Returns the source sets executing the functional tests with TestKit. Defaults to project.sourceSets.test.

isAutomatedPublishing

open fun isAutomatedPublishing(): Boolean

Whether the plugin should automatically configure the publications for the plugins.

pluginSourceSet

open fun pluginSourceSet(pluginSourceSet: SourceSet): Unit

Provides the source set that compiles the code under test.

plugins

open fun plugins(action: Action<in NamedDomainObjectContainer<PluginDeclaration>>): Unit

Configures the declared plugins.

setAutomatedPublishing

open fun setAutomatedPublishing(automatedPublishing: Boolean): Unit

Configures whether the plugin should automatically configure the publications for the plugins.

testSourceSets

open fun testSourceSets(vararg testSourceSets: SourceSet): Unit

Provides the source sets executing the functional tests with TestKit.

Calling this method multiple times with different source sets is not additive.

Extension Properties

ext

val GradlePluginDevelopmentExtension.ext: ExtraPropertiesExtension

Retrieves the ext extension.

Extension Functions

ext

fun GradlePluginDevelopmentExtension.ext(configure: ExtraPropertiesExtension.() -> Unit): Unit

Configures the ext extension.