Comparable<Task>
, org.gradle.api.internal.DynamicObjectAware
, org.gradle.api.internal.IConventionAware
, org.gradle.api.internal.TaskInternal
, ExtensionAware
, Task
, PatternFilterable
, Configurable<Task>
AbstractCompile
, AntlrTask
, Checkstyle
, CodeNarc
, Groovydoc
, Javadoc
, Pmd
, ScalaDoc
@NonNullApi @DisableCachingByDefault(because="Super-class, not to be instantiated directly") public class SourceTask extends org.gradle.api.internal.ConventionTask implements PatternFilterable
SourceTask
performs some operation on source files.Task.Namer
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor | Description |
---|---|
SourceTask() |
Modifier and Type | Method | Description |
---|---|---|
SourceTask |
exclude(Closure excludeSpec) |
Adds an exclude spec.
|
SourceTask |
exclude(Iterable<String> excludes) |
Adds an ANT style exclude pattern.
|
SourceTask |
exclude(String... excludes) |
Adds an ANT style exclude pattern.
|
SourceTask |
exclude(Spec<FileTreeElement> excludeSpec) |
Adds an exclude spec.
|
Set<String> |
getExcludes() |
Returns the set of exclude patterns.
|
Set<String> |
getIncludes() |
Returns the set of include patterns.
|
protected PatternFilterable |
getPatternSet() |
|
protected org.gradle.internal.Factory<PatternSet> |
getPatternSetFactory() |
|
FileTree |
getSource() |
Returns the source for this task, after the include and exclude patterns have been applied.
|
SourceTask |
include(Closure includeSpec) |
Adds an include spec.
|
SourceTask |
include(Iterable<String> includes) |
Adds an ANT style include pattern.
|
SourceTask |
include(String... includes) |
Adds an ANT style include pattern.
|
SourceTask |
include(Spec<FileTreeElement> includeSpec) |
Adds an include spec.
|
SourceTask |
setExcludes(Iterable<String> excludes) |
Set the allowable exclude patterns.
|
SourceTask |
setIncludes(Iterable<String> includes) |
Set the allowable include patterns.
|
void |
setSource(Object source) |
Sets the source for this task.
|
void |
setSource(FileTree source) |
Sets the source for this task.
|
SourceTask |
source(Object... sources) |
Adds some source to this task.
|
conventionMapping, conventionMapping, getConventionMapping
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getReasonNotToTrackState, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjects
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doNotTrackState, getConvention
@Inject protected org.gradle.internal.Factory<PatternSet> getPatternSetFactory()
@Internal protected PatternFilterable getPatternSet()
@InputFiles @SkipWhenEmpty @IgnoreEmptyDirectories @PathSensitive(ABSOLUTE) public FileTree getSource()
The PathSensitivity
for the sources is configured to be PathSensitivity.ABSOLUTE
.
If your sources are less strict, please change it accordingly by overriding this method in your subclass.
public void setSource(FileTree source)
source
- The source.public void setSource(Object source)
Project.files(Object...)
.source
- The source.public SourceTask source(Object... sources)
Project.files(Object...)
.sources
- The source to addpublic SourceTask include(String... includes)
include
in interface PatternFilterable
includes
- a vararg list of include patternsPattern Format
public SourceTask include(Iterable<String> includes)
include
in interface PatternFilterable
includes
- a Iterable providing more include patternsPattern Format
public SourceTask include(Spec<FileTreeElement> includeSpec)
include
in interface PatternFilterable
includeSpec
- the spec to addPattern Format
public SourceTask include(Closure includeSpec)
FileTreeElement
as its parameter.
If includes are not provided, then all files in this container will be included. If includes are provided, then a
file must match at least one of the include patterns or specs to be included.include
in interface PatternFilterable
includeSpec
- the spec to addPattern Format
public SourceTask exclude(String... excludes)
exclude
in interface PatternFilterable
excludes
- a vararg list of exclude patternsPattern Format
public SourceTask exclude(Iterable<String> excludes)
exclude
in interface PatternFilterable
excludes
- a Iterable providing new exclude patternsPattern Format
public SourceTask exclude(Spec<FileTreeElement> excludeSpec)
exclude
in interface PatternFilterable
excludeSpec
- the spec to addPattern Format
public SourceTask exclude(Closure excludeSpec)
FileTreeElement
as its parameter. The closure should return true or false. Example:
copySpec { from 'source' into 'destination' //an example of excluding files from certain configuration: exclude { it.file in configurations.someConf.files } }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.
exclude
in interface PatternFilterable
excludeSpec
- the spec to addFileTreeElement
@Internal public Set<String> getIncludes()
getIncludes
in interface PatternFilterable
public SourceTask setIncludes(Iterable<String> includes)
PatternFilterable.include(Iterable)
this replaces any previously
defined includes.setIncludes
in interface PatternFilterable
includes
- an Iterable providing new include patternsPattern Format
@Internal public Set<String> getExcludes()
getExcludes
in interface PatternFilterable
public SourceTask setExcludes(Iterable<String> excludes)
PatternFilterable.exclude(Iterable)
this replaces any previously
defined excludes.setExcludes
in interface PatternFilterable
excludes
- an Iterable providing new exclude patternsPattern Format