Klasse DefaultTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
Alle implementierten Schnittstellen:
Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, Named, ExtensionAware, Task, Configurable<Task>
Bekannte direkte Unterklassen:
AbstractConfigurationReportTask, AbstractLinkTask, AbstractNativeCompileTask, AbstractPublishToMaven, ArtifactTransformsReportTask, Assemble, BuildEnvironmentReportTask, ComponentReport, org.gradle.api.internal.ConventionTask, CreateStaticLibrary, DependencyInsightReportTask, DependentComponentsReport, ExtractSymbols, GenerateBuildDashboard, GenerateCUnitLauncher, GenerateIvyDescriptor, GenerateMavenPom, GenerateModuleMetadata, GeneratePluginDescriptors, GenerateSwiftPackageManagerManifest, InitBuild, InstallExecutable, InstallXCTestBundle, JacocoBase, ModelReport, PluginUnderTestMetadata, PrefixHeaderFileGenerateTask, PublishToIvyRepository, Sign, StripSymbols, SwiftCompile, TestReport, UnexportMainSymbol, UpdateDaemonJvm, ValidatePlugins, WindowsResourceCompile, Wrapper, WriteProperties

@DisableCachingByDefault(because="Gradle would require more information to cache this task") public abstract class DefaultTask extends org.gradle.api.internal.AbstractTask implements Task
DefaultTask is the standard Task implementation. You can extend this to implement your own task types.
  • Konstruktordetails

    • DefaultTask

      public DefaultTask()
  • Methodendetails

    • getAnt

      public AntBuilder getAnt()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the AntBuilder for this task. You can use this in your build file to execute ant tasks.

      Angegeben von:
      getAnt in Schnittstelle Task
      Setzt außer Kraft:
      getAnt in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The AntBuilder
    • getProject

      public Project getProject()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the Project which this task belongs to.

      Calling this method from a task action is not supported when configuration caching is enabled.

      Angegeben von:
      getProject in Schnittstelle Task
      Setzt außer Kraft:
      getProject in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The project this task belongs to. Never returns null.
    • getName

      public String getName()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the name of this task. The name uniquely identifies the task within its Project.

      Angegeben von:
      getName in Schnittstelle Named
      Angegeben von:
      getName in Schnittstelle Task
      Setzt außer Kraft:
      getName in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The name of the task. Never returns null.
    • getActions

      public List<Action<? super Task>> getActions()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the sequence of Action objects which will be executed by this task, in the order of execution.

      Angegeben von:
      getActions in Schnittstelle Task
      Setzt außer Kraft:
      getActions in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The task actions in the order they are executed. Returns an empty list if this task has no actions.
    • setActions

      public void setActions(List<Action<? super Task>> replacements)
      Beschreibung aus Schnittstelle kopiert: Task

      Sets the sequence of Action objects which will be executed by this task.

      Angegeben von:
      setActions in Schnittstelle Task
      Setzt außer Kraft:
      setActions in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      replacements - The actions.
    • getDependsOn

      public Set<Object> getDependsOn()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the dependencies of this task.

      Angegeben von:
      getDependsOn in Schnittstelle Task
      Setzt außer Kraft:
      getDependsOn in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The dependencies of this task. Returns an empty set if this task has no dependencies.
    • setDependsOn

      public void setDependsOn(Iterable<?> dependsOn)
      Beschreibung aus Schnittstelle kopiert: Task

      Sets the dependencies of this task. See here for a description of the types of objects which can be used as task dependencies.

      Angegeben von:
      setDependsOn in Schnittstelle Task
      Setzt außer Kraft:
      setDependsOn in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      dependsOn - The set of task paths.
    • onlyIf

      public void onlyIf(Spec<? super Task> spec)
      Beschreibung aus Schnittstelle kopiert: Task

      Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not during configuration. If the Spec is not satisfied, the task will be skipped.

      You may add multiple such predicates. The task is skipped if any of the predicates return false.

      Typical usage (from Java):

      myTask.onlyIf(new Spec<Task>() {
          boolean isSatisfiedBy(Task task) {
             return isProductionEnvironment();
          }
       });
       
      Angegeben von:
      onlyIf in Schnittstelle Task
      Setzt außer Kraft:
      onlyIf in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      spec - specifies if a task should be run
    • onlyIf

      public void onlyIf(String onlyIfReason, Spec<? super Task> spec)
      Beschreibung aus Schnittstelle kopiert: Task

      Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not during configuration. If the Spec is not satisfied, the task will be skipped.

      You may add multiple such predicates. The task is skipped if any of the predicates return false.

      Typical usage (from Java):

      myTask.onlyIf("run only in production environment", new Spec<Task>() {
          boolean isSatisfiedBy(Task task) {
             return isProductionEnvironment();
          }
       });
       
      Angegeben von:
      onlyIf in Schnittstelle Task
      Setzt außer Kraft:
      onlyIf in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      onlyIfReason - specifies the reason for a task to run, which is used for logging
      spec - specifies if a task should be run
    • setOnlyIf

      public void setOnlyIf(Spec<? super Task> spec)
      Beschreibung aus Schnittstelle kopiert: Task

      Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not during configuration. If the Spec is not satisfied, the task will be skipped.

      The given predicate replaces all such predicates for this task.

      Angegeben von:
      setOnlyIf in Schnittstelle Task
      Setzt außer Kraft:
      setOnlyIf in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      spec - specifies if a task should be run
    • setOnlyIf

      public void setOnlyIf(String onlyIfReason, Spec<? super Task> spec)
      Beschreibung aus Schnittstelle kopiert: Task

      Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not during configuration. If the Spec is not satisfied, the task will be skipped.

      The given predicate replaces all such predicates for this task.

      Angegeben von:
      setOnlyIf in Schnittstelle Task
      Setzt außer Kraft:
      setOnlyIf in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      onlyIfReason - specifies the reason for a task to run, which is used for logging
      spec - specifies if a task should be run
    • getDidWork

      public boolean getDidWork()
      Beschreibung aus Schnittstelle kopiert: Task

      Checks if the task actually did any work. Even if a Task executes, it may determine that it has nothing to do. For example, a compilation task may determine that source files have not changed since the last time a the task was run.

      Angegeben von:
      getDidWork in Schnittstelle Task
      Setzt außer Kraft:
      getDidWork in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      true if this task did any work
    • setDidWork

      public void setDidWork(boolean didWork)
      Beschreibung aus Schnittstelle kopiert: Task
      Sets whether the task actually did any work. Most built-in tasks will set this automatically, but it may be useful to manually indicate this for custom user tasks.
      Angegeben von:
      setDidWork in Schnittstelle Task
      Setzt außer Kraft:
      setDidWork in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      didWork - indicates if the task did any work
    • getEnabled

      public boolean getEnabled()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns if this task is enabled or not.

      Angegeben von:
      getEnabled in Schnittstelle Task
      Setzt außer Kraft:
      getEnabled in Klasse org.gradle.api.internal.AbstractTask
      Siehe auch:
    • setEnabled

      public void setEnabled(boolean enabled)
      Beschreibung aus Schnittstelle kopiert: Task

      Set the enabled state of a task. If a task is disabled none of the its actions are executed. Note that disabling a task does not prevent the execution of the tasks which this task depends on.

      Angegeben von:
      setEnabled in Schnittstelle Task
      Setzt außer Kraft:
      setEnabled in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      enabled - The enabled state of this task (true or false)
    • getPath

      public String getPath()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the path of the task, which is a fully qualified name for the task. The path of a task is the path of its Project plus the name of the task, separated by :.

      Angegeben von:
      getPath in Schnittstelle Task
      Setzt außer Kraft:
      getPath in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      the path of the task, which is equal to the path of the project plus the name of the task.
    • dependsOn

      public Task dependsOn(Object... paths)
      Beschreibung aus Schnittstelle kopiert: Task

      Adds the given dependencies to this task. See here for a description of the types of objects which can be used as task dependencies.

      Angegeben von:
      dependsOn in Schnittstelle Task
      Setzt außer Kraft:
      dependsOn in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      paths - The dependencies to add to this task.
      Gibt zurück:
      the task object this method is applied to
    • doFirst

      public Task doFirst(Action<? super Task> action)
      Beschreibung aus Schnittstelle kopiert: Task

      Adds the given Action to the beginning of this task's action list.

      Angegeben von:
      doFirst in Schnittstelle Task
      Setzt außer Kraft:
      doFirst in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      action - The action to add
      Gibt zurück:
      the task object this method is applied to
    • doFirst

      public Task doFirst(String actionName, Action<? super Task> action)
      Beschreibung aus Schnittstelle kopiert: Task

      Adds the given Action to the beginning of this task's action list.

      Angegeben von:
      doFirst in Schnittstelle Task
      Setzt außer Kraft:
      doFirst in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      actionName - An arbitrary string that is used for logging.
      action - The action to add
      Gibt zurück:
      the task object this method is applied to
    • doLast

      public Task doLast(Action<? super Task> action)
      Beschreibung aus Schnittstelle kopiert: Task

      Adds the given Action to the end of this task's action list.

      Angegeben von:
      doLast in Schnittstelle Task
      Setzt außer Kraft:
      doLast in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      action - The action to add.
      Gibt zurück:
      the task object this method is applied to
    • doLast

      public Task doLast(String actionName, Action<? super Task> action)
      Beschreibung aus Schnittstelle kopiert: Task

      Adds the given Action to the end of this task's action list.

      Angegeben von:
      doLast in Schnittstelle Task
      Setzt außer Kraft:
      doLast in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      actionName - An arbitrary string that is used for logging.
      action - The action to add.
      Gibt zurück:
      the task object this method is applied to
    • compareTo

      public int compareTo(Task otherTask)
      Angegeben von:
      compareTo in Schnittstelle Comparable<Task>
      Setzt außer Kraft:
      compareTo in Klasse org.gradle.api.internal.AbstractTask
    • getLogger

      public Logger getLogger()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the logger for this task. You can use this in your build file to write log messages.

      Angegeben von:
      getLogger in Schnittstelle Task
      Setzt außer Kraft:
      getLogger in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The logger. Never returns null.
    • property

      public Object property(String propertyName) throws MissingPropertyException
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the value of the given property of this task. This method locates a property as follows:

      1. If this task object has a property with the given name, return the value of the property.
      2. If this task has an extension with the given name, return the extension.
      3. If this task's convention object has a property with the given name, return the value of the property.
      4. If this task has an extra property with the given name, return the value of the property.
      5. If not found, throw MissingPropertyException
      Angegeben von:
      property in Schnittstelle Task
      Setzt außer Kraft:
      property in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      propertyName - The name of the property.
      Gibt zurück:
      The value of the property, possibly null.
      Löst aus:
      MissingPropertyException - When the given property is unknown.
    • hasProperty

      public boolean hasProperty(String propertyName)
      Beschreibung aus Schnittstelle kopiert: Task

      Determines if this task has the given property. See here for details of the properties which are available for a task.

      Angegeben von:
      hasProperty in Schnittstelle Task
      Setzt außer Kraft:
      hasProperty in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      propertyName - The name of the property to locate.
      Gibt zurück:
      True if this project has the given property, false otherwise.
    • setProperty

      public void setProperty(String name, Object value)
      Beschreibung aus Schnittstelle kopiert: Task

      Sets a property of this task. This method searches for a property with the given name in the following locations, and sets the property on the first location where it finds the property.

      1. The task object itself. For example, the enabled project property.
      2. The task's convention object.
      3. The task's extra properties.
      If the property is not found, a MissingPropertyException is thrown.
      Angegeben von:
      setProperty in Schnittstelle Task
      Setzt außer Kraft:
      setProperty in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      name - The name of the property
      value - The value of the property
    • getDescription

      public String getDescription()
      Beschreibung aus Schnittstelle kopiert: Task
      Returns the description of this task.
      Angegeben von:
      getDescription in Schnittstelle Task
      Setzt außer Kraft:
      getDescription in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      the description. May return null.
    • setDescription

      public void setDescription(String description)
      Beschreibung aus Schnittstelle kopiert: Task
      Sets a description for this task. This should describe what the task does to the user of the build. The description will be displayed when gradle tasks is called.
      Angegeben von:
      setDescription in Schnittstelle Task
      Setzt außer Kraft:
      setDescription in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      description - The description of the task. Might be null.
    • getGroup

      public String getGroup()
      Beschreibung aus Schnittstelle kopiert: Task
      Returns the task group which this task belongs to. The task group is used in reports and user interfaces to group related tasks together when presenting a list of tasks to the user.
      Angegeben von:
      getGroup in Schnittstelle Task
      Setzt außer Kraft:
      getGroup in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The task group for this task. Might be null.
    • setGroup

      public void setGroup(String group)
      Beschreibung aus Schnittstelle kopiert: Task
      Sets the task group which this task belongs to. The task group is used in reports and user interfaces to group related tasks together when presenting a list of tasks to the user.
      Angegeben von:
      setGroup in Schnittstelle Task
      Setzt außer Kraft:
      setGroup in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      group - The task group for this task. Can be null.
    • getDestroyables

      public TaskDestroyables getDestroyables()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the destroyables of this task.

      Angegeben von:
      getDestroyables in Schnittstelle Task
      Setzt außer Kraft:
      getDestroyables in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The destroyables. Never returns null.
    • getLocalState

      public TaskLocalState getLocalState()
      Beschreibung aus Schnittstelle kopiert: Task
      Returns the local state of this task.
      Angegeben von:
      getLocalState in Schnittstelle Task
      Setzt außer Kraft:
      getLocalState in Klasse org.gradle.api.internal.AbstractTask
    • getTemporaryDir

      public File getTemporaryDir()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns a directory which this task can use to write temporary files to. Each task instance is provided with a separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the execution of the task.

      Angegeben von:
      getTemporaryDir in Schnittstelle Task
      Setzt außer Kraft:
      getTemporaryDir in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The directory. Never returns null. The directory will already exist.
    • setMustRunAfter

      public void setMustRunAfter(Iterable<?> mustRunAfterTasks)
      Beschreibung aus Schnittstelle kopiert: Task

      Specifies the set of tasks that this task must run after.

       task taskY {
           mustRunAfter = ["taskX1", "taskX2"]
       }
       

      For each supplied task, this action adds a task 'ordering', and does not specify a 'dependency' between the tasks. As such, it is still possible to execute 'taskY' without first executing the 'taskX' in the example.

      See here for a description of the types of objects which can be used to specify an ordering relationship.

      Angegeben von:
      setMustRunAfter in Schnittstelle Task
      Setzt außer Kraft:
      setMustRunAfter in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      mustRunAfterTasks - The set of task paths this task must run after.
    • mustRunAfter

      public Task mustRunAfter(Object... paths)
      Beschreibung aus Schnittstelle kopiert: Task

      Specifies that this task must run after all of the supplied tasks.

       task taskY {
           mustRunAfter "taskX"
       }
       

      For each supplied task, this action adds a task 'ordering', and does not specify a 'dependency' between the tasks. As such, it is still possible to execute 'taskY' without first executing the 'taskX' in the example.

      See here for a description of the types of objects which can be used to specify an ordering relationship.

      Angegeben von:
      mustRunAfter in Schnittstelle Task
      Setzt außer Kraft:
      mustRunAfter in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      paths - The tasks this task must run after.
      Gibt zurück:
      the task object this method is applied to
    • getMustRunAfter

      public TaskDependency getMustRunAfter()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns tasks that this task must run after.

      Angegeben von:
      getMustRunAfter in Schnittstelle Task
      Setzt außer Kraft:
      getMustRunAfter in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The tasks that this task must run after. Returns an empty set if this task has no tasks it must run after.
    • setFinalizedBy

      public void setFinalizedBy(Iterable<?> finalizedByTasks)
      Beschreibung aus Schnittstelle kopiert: Task

      Specifies the set of finalizer tasks for this task.

       task taskY {
           finalizedBy = ["taskX1", "taskX2"]
       }
       

      See here for a description of the types of objects which can be used to specify a finalizer task.

      Angegeben von:
      setFinalizedBy in Schnittstelle Task
      Setzt außer Kraft:
      setFinalizedBy in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      finalizedByTasks - The tasks that finalize this task.
    • finalizedBy

      public Task finalizedBy(Object... paths)
      Beschreibung aus Schnittstelle kopiert: Task

      Adds the given finalizer tasks for this task.

       task taskY {
           finalizedBy "taskX"
       }
       

      See here for a description of the types of objects which can be used to specify a finalizer task.

      Angegeben von:
      finalizedBy in Schnittstelle Task
      Setzt außer Kraft:
      finalizedBy in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      paths - The tasks that finalize this task.
      Gibt zurück:
      the task object this method is applied to
    • getFinalizedBy

      public TaskDependency getFinalizedBy()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns tasks that finalize this task.

      Angegeben von:
      getFinalizedBy in Schnittstelle Task
      Setzt außer Kraft:
      getFinalizedBy in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The tasks that finalize this task. Returns an empty set if there are no finalising tasks for this task.
    • shouldRunAfter

      public TaskDependency shouldRunAfter(Object... paths)
      Beschreibung aus Schnittstelle kopiert: Task

      Specifies that this task should run after all of the supplied tasks.

       task taskY {
           shouldRunAfter "taskX"
       }
       

      For each supplied task, this action adds a task 'ordering', and does not specify a 'dependency' between the tasks. As such, it is still possible to execute 'taskY' without first executing the 'taskX' in the example.

      See here for a description of the types of objects which can be used to specify an ordering relationship.

      Angegeben von:
      shouldRunAfter in Schnittstelle Task
      Setzt außer Kraft:
      shouldRunAfter in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      paths - The tasks this task should run after.
      Gibt zurück:
      the task object this method is applied to
    • setShouldRunAfter

      public void setShouldRunAfter(Iterable<?> shouldRunAfterTasks)
      Beschreibung aus Schnittstelle kopiert: Task

      Specifies the set of tasks that this task should run after.

       task taskY {
           shouldRunAfter = ["taskX1", "taskX2"]
       }
       

      For each supplied task, this action adds a task 'ordering', and does not specify a 'dependency' between the tasks. As such, it is still possible to execute 'taskY' without first executing the 'taskX' in the example.

      See here for a description of the types of objects which can be used to specify an ordering relationship.

      Angegeben von:
      setShouldRunAfter in Schnittstelle Task
      Setzt außer Kraft:
      setShouldRunAfter in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      shouldRunAfterTasks - The set of task paths this task should run after.
    • getShouldRunAfter

      public TaskDependency getShouldRunAfter()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns tasks that this task should run after.

      Angegeben von:
      getShouldRunAfter in Schnittstelle Task
      Setzt außer Kraft:
      getShouldRunAfter in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The tasks that this task should run after. Returns an empty set if this task has no tasks it must run after.
    • getTimeout

      public Property<Duration> getTimeout()
      Beschreibung aus Schnittstelle kopiert: Task

      The timeout of this task.

         task myTask {
             timeout = Duration.ofMinutes(10)
         }
       

      The Thread executing this task will be interrupted if the task takes longer than the specified amount of time to run. In order for a task to work properly with this feature, it needs to react to interrupts and must clean up any resources it opened.

      By default, tasks never time out.

      Angegeben von:
      getTimeout in Schnittstelle Task
      Setzt außer Kraft:
      getTimeout in Klasse org.gradle.api.internal.AbstractTask
    • usesService

      public void usesService(Provider<? extends BuildService<?>> service)
      Beschreibung aus Schnittstelle kopiert: Task
      Registers a BuildService that is used by this task so its constraint on parallel execution can be honored.

      This is not necessary for task properties declared as ServiceReferences.

      Angegeben von:
      usesService in Schnittstelle Task
      Setzt außer Kraft:
      usesService in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      service - The service provider.
      Siehe auch:
    • getState

      public org.gradle.api.internal.tasks.TaskStateInternal getState()
      Beschreibung aus Schnittstelle kopiert: Task
      Returns the execution state of this task. This provides information about the execution of this task, such as whether it has executed, been skipped, has failed, etc.
      Angegeben von:
      getState in Schnittstelle Task
      Angegeben von:
      getState in Schnittstelle org.gradle.api.internal.TaskInternal
      Setzt außer Kraft:
      getState in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The execution state of this task. Never returns null.
    • getTaskDependencies

      public org.gradle.api.internal.tasks.TaskDependencyInternal getTaskDependencies()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns a TaskDependency which contains all the tasks that this task depends on.

      Calling this method from a task action is not supported when configuration caching is enabled.

      Angegeben von:
      getTaskDependencies in Schnittstelle Task
      Setzt außer Kraft:
      getTaskDependencies in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The dependencies of this task. Never returns null.
    • onlyIf

      public void onlyIf(Closure onlyIfClosure)
      Beschreibung aus Schnittstelle kopiert: Task

      Execute the task only if the given closure returns true. The closure will be evaluated at task execution time, not during configuration. The closure will be passed a single parameter, this task. If the closure returns false, the task will be skipped.

      You may add multiple such predicates. The task is skipped if any of the predicates return false.

      Typical usage:myTask.onlyIf { isProductionEnvironment() }

      Angegeben von:
      onlyIf in Schnittstelle Task
      Setzt außer Kraft:
      onlyIf in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      onlyIfClosure - code to execute to determine if task should be run
    • setOnlyIf

      public void setOnlyIf(Closure onlyIfClosure)
      Beschreibung aus Schnittstelle kopiert: Task

      Execute the task only if the given closure returns true. The closure will be evaluated at task execution time, not during configuration. The closure will be passed a single parameter, this task. If the closure returns false, the task will be skipped.

      The given predicate replaces all such predicates for this task.

      Angegeben von:
      setOnlyIf in Schnittstelle Task
      Setzt außer Kraft:
      setOnlyIf in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      onlyIfClosure - code to execute to determine if task should be run
    • getLogging

      public LoggingManager getLogging()
      Beschreibung aus Schnittstelle kopiert: Task
      Returns the LoggingManager which can be used to receive logging and to control the standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at the QUIET log level, and System.err is redirected at the ERROR log level.
      Angegeben von:
      getLogging in Schnittstelle Task
      Setzt außer Kraft:
      getLogging in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      the LoggingManager. Never returns null.
    • getInputs

      public org.gradle.api.internal.TaskInputsInternal getInputs()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the inputs of this task.

      Angegeben von:
      getInputs in Schnittstelle Task
      Angegeben von:
      getInputs in Schnittstelle org.gradle.api.internal.TaskInternal
      Setzt außer Kraft:
      getInputs in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The inputs. Never returns null.
    • getOutputs

      public org.gradle.api.internal.TaskOutputsInternal getOutputs()
      Beschreibung aus Schnittstelle kopiert: Task

      Returns the outputs of this task.

      Angegeben von:
      getOutputs in Schnittstelle Task
      Angegeben von:
      getOutputs in Schnittstelle org.gradle.api.internal.TaskInternal
      Setzt außer Kraft:
      getOutputs in Klasse org.gradle.api.internal.AbstractTask
      Gibt zurück:
      The outputs. Never returns null.
    • doFirst

      public Task doFirst(Closure action)
      Beschreibung aus Schnittstelle kopiert: Task

      Adds the given closure to the beginning of this task's action list. The closure is passed this task as a parameter when executed.

      Angegeben von:
      doFirst in Schnittstelle Task
      Setzt außer Kraft:
      doFirst in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      action - The action closure to execute.
      Gibt zurück:
      This task.
    • doLast

      public Task doLast(Closure action)
      Beschreibung aus Schnittstelle kopiert: Task

      Adds the given closure to the end of this task's action list. The closure is passed this task as a parameter when executed.

      Angegeben von:
      doLast in Schnittstelle Task
      Setzt außer Kraft:
      doLast in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      action - The action closure to execute.
      Gibt zurück:
      This task.
    • configure

      public Task configure(Closure closure)
      Beschreibung aus Schnittstelle kopiert: Task

      Applies the statements of the closure against this task object. The delegate object for the closure is set to this task.

      Angegeben von:
      configure in Schnittstelle Configurable<Task>
      Angegeben von:
      configure in Schnittstelle Task
      Setzt außer Kraft:
      configure in Klasse org.gradle.api.internal.AbstractTask
      Parameter:
      closure - The closure to be applied (can be null).
      Gibt zurück:
      This task
    • getExtensions

      public ExtensionContainer getExtensions()
      Beschreibung aus Schnittstelle kopiert: ExtensionAware
      The container of extensions.
      Angegeben von:
      getExtensions in Schnittstelle ExtensionAware
      Setzt außer Kraft:
      getExtensions in Klasse org.gradle.api.internal.AbstractTask