Interface ProjectOrSettingsPlugin

  • All Superinterfaces:
    org.gradle.api.Plugin<java.lang.Object>

    public interface ProjectOrSettingsPlugin
    extends org.gradle.api.Plugin<java.lang.Object>
    A plugin that can be applied to either a Project or Settings.
    Since:
    1.3.0
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void apply​(@NotNull java.lang.Object target)  
      void applyToProject​(@NotNull org.gradle.api.Project target, @NotNull org.gradle.api.plugins.PluginContainer plugins, @NotNull org.gradle.api.plugins.ExtensionContainer extensions, @NotNull org.gradle.api.tasks.TaskContainer tasks)
      Called when this plugin is applied to a Project instance.
      void applyToSettings​(@NotNull org.gradle.api.initialization.Settings target, @NotNull org.gradle.api.plugins.PluginContainer plugins, @NotNull org.gradle.api.plugins.ExtensionContainer extensions)
      Called when this plugin is applied to a Settings instance.
      default boolean isAppliedToSettingsOf​(@NotNull org.gradle.api.Project project)
      Determine if this plugin has been applied to the Settings instance associated with a particular project.
      default @Nullable org.gradle.util.GradleVersion minimumGradleVersion()
      Return a minimum Gradle version required to use this plugin.
    • Method Detail

      • apply

        default void apply​(@NotNull
                           @NotNull java.lang.Object target)
        Specified by:
        apply in interface org.gradle.api.Plugin<java.lang.Object>
      • applyToProject

        void applyToProject​(@NotNull
                            @NotNull org.gradle.api.Project target,
                            @NotNull
                            @NotNull org.gradle.api.plugins.PluginContainer plugins,
                            @NotNull
                            @NotNull org.gradle.api.plugins.ExtensionContainer extensions,
                            @NotNull
                            @NotNull org.gradle.api.tasks.TaskContainer tasks)
        Called when this plugin is applied to a Project instance.
        Parameters:
        target - the project this plugin is being applied to
        plugins - the plugin container
        extensions - the extension container
        tasks - the task container
        Since:
        1.3.0
      • applyToSettings

        void applyToSettings​(@NotNull
                             @NotNull org.gradle.api.initialization.Settings target,
                             @NotNull
                             @NotNull org.gradle.api.plugins.PluginContainer plugins,
                             @NotNull
                             @NotNull org.gradle.api.plugins.ExtensionContainer extensions)
        Called when this plugin is applied to a Settings instance.
        Parameters:
        target - the settings this plugin is being applied to
        plugins - the plugin container
        extensions - the extension container
        Since:
        1.3.0
      • minimumGradleVersion

        @Nullable
        default @Nullable org.gradle.util.GradleVersion minimumGradleVersion()
        Return a minimum Gradle version required to use this plugin.
        Returns:
        the minimum required version
        Since:
        1.2.0
      • isAppliedToSettingsOf

        default boolean isAppliedToSettingsOf​(@NotNull
                                              @NotNull org.gradle.api.Project project)
        Determine if this plugin has been applied to the Settings instance associated with a particular project.
        Parameters:
        project - the project to test
        Returns:
        whether the Settings that created the provided project has this plugin applied
        Since:
        1.3.0