GradlePluginDevelopmentExtension (Gradle API 7.6.3)

Package org.gradle.plugin.devel

## Class GradlePluginDevelopmentExtension

- java.lang.Object
- - org.gradle.plugin.devel.GradlePluginDevelopmentExtension

-     public class GradlePluginDevelopmentExtension
      extends java.lang.Object

  Configuration options for the `JavaGradlePluginPlugin`.

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

           plugins {
               id 'java-gradle-plugin'
           }

           sourceSets {
               customMain
               functionalTest
           }

           gradlePlugin {
               pluginSourceSet project.sourceSets.customMain
               testSourceSets project.sourceSets.functionalTest
               plugins {
                   helloPlugin {
                       id  = 'org.example.hello'
                       implementationClass = 'org.example.HelloPlugin'
                   }
               }
           }

  Since:
    2.13
  See Also:
    `JavaGradlePluginPlugin`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GradlePluginDevelopmentExtension​(Project project, SourceSet pluginSourceSet, SourceSet testSourceSet)` |
    `GradlePluginDevelopmentExtension​(Project project, SourceSet pluginSourceSet, SourceSet[] testSourceSets)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `NamedDomainObjectContainer<PluginDeclaration>` | `getPlugins()` | Returns the declared plugins.
    `SourceSet` | `getPluginSourceSet()` | Returns the source set that compiles the code under test.
    `java.util.Set<SourceSet>` | `getTestSourceSets()` | Returns the source sets executing the functional tests with TestKit.
    `Property<java.lang.String>` | `getVcsUrl()` | Returns the property holding the URL for the plugin's VCS repository.
    `Property<java.lang.String>` | `getWebsite()` | Returns the property holding the URL for the plugin's website.
    `boolean` | `isAutomatedPublishing()` | Whether the plugin should automatically configure the publications for the plugins.
    `void` | `plugins​(Action<? super NamedDomainObjectContainer<PluginDeclaration>> action)` | Configures the declared plugins.
    `void` | `pluginSourceSet​(SourceSet pluginSourceSet)` | Provides the source set that compiles the code under test.
    `void` | `setAutomatedPublishing​(boolean automatedPublishing)` | Configures whether the plugin should automatically configure the publications for the plugins.
    `void` | `testSourceSet​(SourceSet testSourceSet)` | Adds some source sets to the collection which will be using TestKit.
    `void` | `testSourceSets​(SourceSet... testSourceSets)` | Provides the source sets executing the functional tests with TestKit.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GradlePluginDevelopmentExtension

          public GradlePluginDevelopmentExtension​(Project project,
                                                  SourceSet pluginSourceSet,
                                                  SourceSet testSourceSet)

    - #### GradlePluginDevelopmentExtension

          public GradlePluginDevelopmentExtension​(Project project,
                                                  SourceSet pluginSourceSet,
                                                  SourceSet[] testSourceSets)

  - ### Method Detail

    - #### pluginSourceSet

          public void pluginSourceSet​(SourceSet pluginSourceSet)

      Provides the source set that compiles the code under test.
      Parameters:
        `pluginSourceSet` - the plugin source set

    - #### testSourceSet

          @Incubating
          public void testSourceSet​(SourceSet testSourceSet)

      Adds some source sets to the collection which will be using TestKit. Calling this method multiple times with different source sets is additive - this method will add to the existing collection of source sets.
      Parameters:
        `testSourceSet` - the test source set to add
      Since:
        7.4

    - #### testSourceSets

          public void testSourceSets​(SourceSet... testSourceSets)

      Provides the source sets executing the functional tests with TestKit.

      Calling this method multiple times with different source sets is NOT additive. Calling this method will overwrite any existing test source sets with the provided arguments.

      Parameters:
        `testSourceSets` - the test source sets

    - #### getPluginSourceSet

          public SourceSet getPluginSourceSet()

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

    - #### getTestSourceSets

          public java.util.Set<SourceSet> getTestSourceSets()

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

    - #### getWebsite

          @Incubating
          public Property<java.lang.String> getWebsite()

      Returns the property holding the URL for the plugin's website.
      Since:
        7.6

    - #### getVcsUrl

          @Incubating
          public Property<java.lang.String> getVcsUrl()

      Returns the property holding the URL for the plugin's VCS repository.
      Since:
        7.6

    - #### getPlugins

          public NamedDomainObjectContainer<PluginDeclaration> getPlugins()

      Returns the declared plugins.
      Returns:
        the declared plugins, never null

    - #### plugins

          public void plugins​(Action<? super NamedDomainObjectContainer<PluginDeclaration>> action)

      Configures the declared plugins.
      Parameters:
        `action` - the configuration action to invoke on the plugins

    - #### isAutomatedPublishing

          public boolean isAutomatedPublishing()

      Whether the plugin should automatically configure the publications for the plugins.
      Returns:
        true if publishing should be automated, false otherwise

    - #### setAutomatedPublishing

          public void setAutomatedPublishing​(boolean automatedPublishing)

      Configures whether the plugin should automatically configure the publications for the plugins.
      Parameters:
        `automatedPublishing` - whether to automated publication