Package: org.gradle.api.tasks

## [Java] Class SourceTask

- org.gradle.api.tasks.SourceTask

- All Implemented Interfaces and Traits:
    PatternFilterable

      public class SourceTask
      extends ConventionTask

  A `SourceTask` performs some operation on source files.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected List<Object>` | `source` |

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `SourceTask` | `exclude(String... excludes)` {@inheritDoc}
    `SourceTask` | `exclude(Iterable<String> excludes)` {@inheritDoc}
    `SourceTask` | `exclude(Spec<FileTreeElement> excludeSpec)` {@inheritDoc}
    `SourceTask` | `exclude(Closure excludeSpec)` {@inheritDoc}
    `Set<String>` | `getExcludes()` {@inheritDoc}
    `Set<String>` | `getIncludes()` {@inheritDoc}
    `FileTree` | `getSource()` Returns the source for this task, after the include and exclude patterns have been applied.
    `SourceTask` | `include(String... includes)` {@inheritDoc}
    `SourceTask` | `include(Iterable<String> includes)` {@inheritDoc}
    `SourceTask` | `include(Spec<FileTreeElement> includeSpec)` {@inheritDoc}
    `SourceTask` | `include(Closure includeSpec)` {@inheritDoc}
    `SourceTask` | `setExcludes(Iterable<String> excludes)` {@inheritDoc}
    `SourceTask` | `setIncludes(Iterable<String> includes)` {@inheritDoc}
    `void` | `setSource(Object source)` Sets the source for this task.
    `SourceTask` | `source(Object... sources)` Adds some source to this task.

- - ### Field Detail

    - #### protected final List<Object> source

  - ### Method Detail

    - #### public SourceTask exclude(String... excludes)

      {@inheritDoc}

    - #### public SourceTask exclude(Iterable<String> excludes)

      {@inheritDoc}

    - #### public SourceTask exclude(Spec<FileTreeElement> excludeSpec)

      {@inheritDoc}

    - #### public SourceTask exclude(Closure excludeSpec)

      {@inheritDoc}

    - #### public Set<String> getExcludes()

      {@inheritDoc}

    - #### public Set<String> getIncludes()

      {@inheritDoc}

    - #### @InputFiles @SkipWhenEmpty public FileTree getSource()

      Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.

      Returns:
        The source.

    - #### public SourceTask include(String... includes)

      {@inheritDoc}

    - #### public SourceTask include(Iterable<String> includes)

      {@inheritDoc}

    - #### public SourceTask include(Spec<FileTreeElement> includeSpec)

      {@inheritDoc}

    - #### public SourceTask include(Closure includeSpec)

      {@inheritDoc}

    - #### public SourceTask setExcludes(Iterable<String> excludes)

      {@inheritDoc}

    - #### public SourceTask setIncludes(Iterable<String> includes)

      {@inheritDoc}

    - #### public void setSource(Object source)

      Sets the source for this task. The given source object is evaluated as per Project.files.

      Parameters:
        `source` - The source.

    - #### public SourceTask source(Object... sources)

      Adds some source to this task. The given source objects will be evaluated as per Project.files.

      Parameters:
        `sources` - The source to add
      Returns:
        this