Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.tasks
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:
  groovy.lang.GroovyObject, java.lang.Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, Task, PatternFilterable

Direct Known Subclasses:
  Checkstyle, CodeNarc, Compile, Groovydoc, Javadoc, ScalaDoc

    public class SourceTask

extends org.gradle.api.internal.ConventionTask
implements PatternFilterable

A `SourceTask` performs some operation on source files.

Field Summary

Fields inherited from interface org.gradle.api.Task
`AUTOSKIP_PROPERTY_PREFIX, TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

Constructor Summary
`SourceTask()`

Method Summary
`SourceTask` | `exclude(java.lang.Iterable<java.lang.String> excludes)` Adds an ANT style exclude pattern.
`SourceTask` | `exclude(java.lang.String... excludes)` Adds an ANT style exclude pattern.
`protected FileTree` | `getDefaultSource()` Returns the default source for this task, if any.
`java.util.Set<java.lang.String>` | `getExcludes()` Get the set of exclude patterns.
`java.util.Set<java.lang.String>` | `getIncludes()` Get the set of include patterns.
`FileTree` | `getSource()` Returns the source for this task, after the include and exclude patterns have been applied.
`SourceTask` | `include(java.lang.Iterable<java.lang.String> includes)` Adds an ANT style include pattern.
`SourceTask` | `include(java.lang.String... includes)` Adds an ANT style include pattern.
`SourceTask` | `setExcludes(java.lang.Iterable<java.lang.String> excludes)` Set the allowable exclude patterns.
`SourceTask` | `setIncludes(java.lang.Iterable<java.lang.String> includes)` Set the allowable include patterns.
`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
`conventionMapping, getConventionMapping, setConventionMapping`

Methods inherited from class org.gradle.api.DefaultTask
`configure, doFirst, doLast, leftShift`

Methods inherited from class org.gradle.api.internal.AbstractTask
`captureStandardOutput, compareTo, defineProperty, deleteAllActions, dependsOn, dependsOnTaskDidWork, disableStandardOutputCapture, doFirst, doLast, equals, execute, getActions, getAdditionalProperties, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getDynamicObjectHelper, getEnabled, getExecuted, getLogger, getName, getOutput, getPath, getProject, getStandardOutputCapture, getTaskDependencies, hashCode, hasProperty, injectIntoNextInstance, isDidWork, isEnabled, isExecuted, onlyIf, onlyIf, property, setActions, setAdditionalProperties, setConvention, setDependsOn, setDescription, setDidWork, setEnabled, setExecuted, setName, setOutputHandler, setProject, setProperty, setStandardOutputCapture, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface groovy.lang.GroovyObject
`getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty`

Constructor Detail

### SourceTask

    public SourceTask()

Method Detail

### getSource

    public FileTree getSource()

  Returns the source for this task, after the include and exclude patterns have been applied.

  Returns:
    The source.

### getDefaultSource

    protected FileTree getDefaultSource()

  Returns the default source for this task, if any.

  Returns:
    The source. May return null.

### setSource

    public void setSource(java.lang.Object source)

  Sets the source for this task. The given source object is evaluated as for `Project.files(Object...)`.

  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(Object...)`.

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

### include

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

  Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If includes are not provided, then all files beneath the base directory will be included. If includes are provided, then a file must match at least one of the include patterns to be processed.

  Specified by:
    `include` in interface `PatternFilterable`
  Parameters:
    `includes` - a vararg list of include patterns
  See Also:
    `Pattern Format`

### include

    public SourceTask include(java.lang.Iterable<java.lang.String> includes)

  Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If includes are not provided, then all files beneath the base directory will be included. If includes are provided, then a file must match at least one of the include patterns to be processed.

  Specified by:
    `include` in interface `PatternFilterable`
  Parameters:
    `includes` - a Iterable providing more include patterns
  See Also:
    `Pattern Format`

### exclude

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

  Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.

  Specified by:
    `exclude` in interface `PatternFilterable`
  Parameters:
    `excludes` - a vararg list of exclude patterns
  See Also:
    `Pattern Format`

### exclude

    public SourceTask exclude(java.lang.Iterable<java.lang.String> excludes)

  Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple patterns may be specified in a single call. If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.

  Specified by:
    `exclude` in interface `PatternFilterable`
  Parameters:
    `excludes` - a Iterable providing new exclude patterns
  See Also:
    `Pattern Format`

### getIncludes

    public java.util.Set<java.lang.String> getIncludes()

  Get the set of include patterns.

  Specified by:
    `getIncludes` in interface `PatternFilterable`

### setIncludes

    public SourceTask setIncludes(java.lang.Iterable<java.lang.String> includes)

  Set the allowable include patterns. Note that unlike `PatternFilterable.include(Iterable)` this replaces any previously defined includes.

  Specified by:
    `setIncludes` in interface `PatternFilterable`
  Parameters:
    `includes` - an Iterable providing new include patterns
  See Also:
    `Pattern Format`

### getExcludes

    public java.util.Set<java.lang.String> getExcludes()

  Get the set of exclude patterns.

  Specified by:
    `getExcludes` in interface `PatternFilterable`

### setExcludes

    public SourceTask setExcludes(java.lang.Iterable<java.lang.String> excludes)

  Set the allowable exclude patterns. Note that unlike `PatternFilterable.exclude(Iterable)` this replaces any previously defined excludes.

  Specified by:
    `setExcludes` in interface `PatternFilterable`
  Parameters:
    `excludes` - an Iterable providing new exclude patterns
  See Also:
    `Pattern Format`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD