Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.tasks
[Java] Class SourceTask

    java.lang.Object
      org.gradle.api.internal.AbstractTask
          org.gradle.api.DefaultTask
              org.gradle.api.internal.ConventionTask
                  org.gradle.api.tasks.SourceTask

All Implemented Interfaces:
  PatternFilterable

    public class SourceTask
    extends org.gradle.api.internal.ConventionTask

A `SourceTask` performs some operation on source files.

Field Summary

Fields inherited from class org.gradle.api.internal.ConventionTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Fields inherited from class DefaultTask
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION

Method Summary
`SourceTask` | `exclude(java.lang.String... excludes)` {@inheritDoc}
`SourceTask` | `exclude(java.lang.Iterable excludes)` {@inheritDoc}
`SourceTask` | `exclude(Spec excludeSpec)` {@inheritDoc}
`SourceTask` | `exclude(groovy.lang.Closure excludeSpec)` {@inheritDoc}
`protected FileTree` | `getDefaultSource()` Returns the default source for this task, if any.
`java.util.Set` | `getExcludes()` {@inheritDoc}
`java.util.Set` | `getIncludes()` {@inheritDoc}
`FileTree` | `getSource()` Returns the source for this task, after the include and exclude patterns have been applied.
`SourceTask` | `include(java.lang.String... includes)` {@inheritDoc}
`SourceTask` | `include(java.lang.Iterable includes)` {@inheritDoc}
`SourceTask` | `include(Spec includeSpec)` {@inheritDoc}
`SourceTask` | `include(groovy.lang.Closure includeSpec)` {@inheritDoc}
`SourceTask` | `setExcludes(java.lang.Iterable excludes)` {@inheritDoc}
`SourceTask` | `setIncludes(java.lang.Iterable includes)` {@inheritDoc}
`void` | `setSource(java.lang.Object source)` Sets the source for this task.
`SourceTask` | `source(java.lang.Object... sources)` Adds some source to this task.

Methods inherited from class org.gradle.api.internal.ConventionTask
org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, org.gradle.api.tasks.ConventionValue), org.gradle.api.internal.ConventionTask#getConventionMapping(), org.gradle.api.internal.ConventionTask#setConventionMapping(org.gradle.api.internal.ConventionMapping), org.gradle.api.internal.ConventionTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.ConventionTask#toString(), org.gradle.api.internal.ConventionTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.ConventionTask#compareTo(java.lang.Object), org.gradle.api.internal.ConventionTask#getName(), org.gradle.api.internal.ConventionTask#getActions(), org.gradle.api.internal.ConventionTask#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getLogger(), org.gradle.api.internal.ConventionTask#execute(), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#getDescription(), org.gradle.api.internal.ConventionTask#isEnabled(), org.gradle.api.internal.ConventionTask#captureStandardOutput(org.gradle.api.logging.LogLevel), org.gradle.api.internal.ConventionTask#disableStandardOutputCapture(), org.gradle.api.internal.ConventionTask#property(java.lang.String), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getProject(), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#getExtensions(), org.gradle.api.internal.ConventionTask#executeWithoutThrowingTaskFailure(), org.gradle.api.internal.ConventionTask#setActions(java.util.List), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getDependsOn(), org.gradle.api.internal.ConventionTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setDidWork(boolean), org.gradle.api.internal.ConventionTask#getDidWork(), org.gradle.api.internal.ConventionTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#doLast(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#deleteAllActions(), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#getAdditionalProperties(), org.gradle.api.internal.ConventionTask#getDynamicObjectHelper(), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.ConventionTask#getValidators(), org.gradle.api.internal.ConventionTask#getExecuter(), org.gradle.api.internal.ConventionTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.ConventionTask#getOnlyIf(), org.gradle.api.internal.ConventionTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#wait(long), org.gradle.api.internal.ConventionTask#wait(long, int), org.gradle.api.internal.ConventionTask#wait(), org.gradle.api.internal.ConventionTask#equals(java.lang.Object), org.gradle.api.internal.ConventionTask#hashCode(), org.gradle.api.internal.ConventionTask#getClass(), org.gradle.api.internal.ConventionTask#notify(), org.gradle.api.internal.ConventionTask#notifyAll()

Methods inherited from class DefaultTask
setProperty, toString, compareTo, compareTo, getName, getActions, setName, getState, getPath, getLogger, execute, configure, configure, getDescription, isEnabled, captureStandardOutput, disableStandardOutputCapture, property, setEnabled, setDescription, getProject, getGroup, setGroup, dependsOn, getAnt, getConvention, hasProperty, getLogging, getExtensions, executeWithoutThrowingTaskFailure, setActions, getTaskDependencies, getTaskDependencies, getDependsOn, setDependsOn, onlyIf, onlyIf, setOnlyIf, setOnlyIf, setDidWork, getDidWork, doFirst, doFirst, doLast, doLast, leftShift, deleteAllActions, getEnabled, dependsOnTaskDidWork, getInputs, getOutputs, getOutputs, getTemporaryDir, setProject, getStandardOutputCapture, getAdditionalProperties, getDynamicObjectHelper, getAsDynamicObject, addValidator, getValidators, getExecuter, setExecuter, getOnlyIf, injectIntoNewInstance, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll

Method Detail

### exclude

    public SourceTask exclude(java.lang.String... excludes)

  {@inheritDoc}

### exclude

    public SourceTask exclude(java.lang.Iterable excludes)

  {@inheritDoc}

### exclude

    public SourceTask exclude(Spec excludeSpec)

  {@inheritDoc}

### exclude

    public SourceTask exclude(groovy.lang.Closure excludeSpec)

  {@inheritDoc}

### getDefaultSource

    protected FileTree getDefaultSource()

  Returns the default source for this task, if any.
  Returns:
    The source. May return null.

### getExcludes

    public java.util.Set getExcludes()

  {@inheritDoc}

### getIncludes

    public java.util.Set getIncludes()

  {@inheritDoc}

### getSource

    @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.

### include

    public SourceTask include(java.lang.String... includes)

  {@inheritDoc}

### include

    public SourceTask include(java.lang.Iterable includes)

  {@inheritDoc}

### include

    public SourceTask include(Spec includeSpec)

  {@inheritDoc}

### include

    public SourceTask include(groovy.lang.Closure includeSpec)

  {@inheritDoc}

### setExcludes

    public SourceTask setExcludes(java.lang.Iterable excludes)

  {@inheritDoc}

### setIncludes

    public SourceTask setIncludes(java.lang.Iterable includes)

  {@inheritDoc}

### setSource

    public void setSource(java.lang.Object source)

  Sets the source for this task. The given source object is evaluated as for Project.files.
  Parameters:
    `source` - The source.

### source

    public SourceTask source(java.lang.Object... sources)

  Adds some source to this task. The given source objects will be evaluated as for Project.files.
  Parameters:
    `sources` - The source to add
  Returns:
    this

Groovy Documentation