Class ReleaseTask

  • All Implemented Interfaces:
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, org.gradle.util.Configurable<Task>

    public class ReleaseTask
    extends DefaultTask
    The Release lifecycle task. This task does not provide any concrete action but is used to group together all the release-related tasks so they can be invoked with just this one simple task.
    • Constructor Detail

      • ReleaseTask

        @Inject
        public ReleaseTask()
        Default constructor
    • Method Detail

      • conditionallyDefine

        public static TaskProvider<ReleaseTask> conditionallyDefine​(Project project)
        Registers the task into the given project if no task with the same name has already been registered. The task is lazily registered, for deferred creation. Either way, when this method returns, a task with this name exists within the project, be it this one or another defined elsewhere (i.e. by user or other plugins).
        Parameters:
        project - the project to define the task for
        Returns:
        the task provider used for the deferred task instantiation or null if a task with the same name was already registered
        See Also:
        define(Project, String, Class, Action)
      • findTask

        protected static TaskProvider<Task> findTask​(Project project,
                                                     String name)
        Returns the provider for the task with the given name or null if no task has been registered or created with such name in the given project. The returned provider can also be used to set a property and is used for lazy instantiation so the task represented by the provider will only be created when it's actually needed. This is the same as TaskCollection.named(String) but in case there is no such task returns null instead of throwing an exception. For this reason this method does not trigger the creation of the task if it was only registered, according to Configuration Avoidance.
        Parameters:
        project - the project to look up the task into
        name - the name of the task to look up
        Returns:
        the provider for the given task or null if there is no such task
      • define

        protected static <T extends TaskTaskProvider<T> define​(Project project,
                                                                 String name,
                                                                 Class<T> type,
                                                                 Action<? super T> configurationAction)
        Registers the task into the given project. Once the task is registered it's not yet instantiated but, instead, a provider object is returned. The provider can also be used to set properties. What's important is that the provider does not instantiate the task until it's actually needed and this prevents unnecessary load. The task is defined lazily so it will be actually created by Gradle only when needed, according to the Configuration Avoidance. For this reason TaskContainer.register(String, Class, Action) is used instead of TaskContainer.create(String, Class, Action) internally.
        Type Parameters:
        T - the task class
        Parameters:
        project - the project to define the task for
        name - the name to register the task with
        type - the task class
        configurationAction - the optional action used to configure the task upon creation. It may be null
        Returns:
        the task provider used for the deferred task instantiation
      • configure

        protected static void configure​(com.mooltiverse.oss.nyx.gradle.AbstractTask task)
        Configures the task by setting the group name. All tasks invoking this method will belong to the GROUP group (onless they override it). Child classes should invoke this method during the configuration phase.
        Parameters:
        task - the task to configure