|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface SourceSet
A SourceSet represents a logical group of Java source and resources.
See the example below how SourceSet 'main' is accessed and how the SourceDirectorySet 'java' is configured to exclude some package from compilation.
apply plugin: 'java' sourceSets { main { java { exclude 'some/unwanted/package/**' } } }
Field Summary | |
---|---|
java.lang.String |
MAIN_SOURCE_SET_NAME
The name of the main source set. |
java.lang.String |
TEST_SOURCE_SET_NAME
The name of the test source set. |
Method Summary | |
---|---|
SourceSet
|
compiledBy(java.lang.Object taskPaths)
Registers a set of tasks which are responsible for compiling this source set into the classes directory. |
SourceDirectorySet
|
getAllJava()
All Java source files for this source set. |
SourceDirectorySet
|
getAllSource()
All source files for this source set. |
SourceSetOutput
|
getClasses()
DEPRECATED: Please use #output property. |
java.io.File
|
getClassesDir()
DEPRECATED: Please use #output.classesDir instead. |
java.lang.String
|
getClassesTaskName()
Returns the name of the classes task for this source set. |
FileCollection
|
getCompileClasspath()
Returns the classpath used to compile this source. |
java.lang.String
|
getCompileJavaTaskName()
Returns the name of the compile Java task for this source set. |
java.lang.String
|
getCompileTaskName(java.lang.String language)
Returns the name of a compile task for this source set. |
SourceDirectorySet
|
getJava()
Returns the Java source which is to be compiled by the Java compiler into the class output directory. |
java.lang.String
|
getName()
Returns the name of this source set. |
SourceSetOutput
|
getOutput()
SourceSetOutput is a FileCollection of all output directories (compiled classes, processed resources, etc.) |
java.lang.String
|
getProcessResourcesTaskName()
Returns the name of the resource process task for this source set. |
SourceDirectorySet
|
getResources()
Returns the non-Java resources which are to be copied into the class output directory. |
FileCollection
|
getRuntimeClasspath()
Returns the classpath used to execute this source. |
java.lang.String
|
getTaskName(java.lang.String verb, java.lang.String target)
Returns the name of a task for this source set. |
SourceSet
|
java(groovy.lang.Closure configureClosure)
Configures the Java source for this set. |
SourceSet
|
resources(groovy.lang.Closure configureClosure)
Configures the non-Java resources for this set. |
void
|
setClassesDir(java.io.File classesDir)
DEPRECATED: Please use #output.resourcesDir instead. |
void
|
setCompileClasspath(FileCollection classpath)
Sets the classpath used to compile this source. |
void
|
setRuntimeClasspath(FileCollection classpath)
Sets the classpath used to execute this source. |
Field Detail |
---|
public java.lang.String MAIN_SOURCE_SET_NAME
public java.lang.String TEST_SOURCE_SET_NAME
Method Detail |
---|
public SourceSet compiledBy(java.lang.Object taskPaths)
taskPaths
- The tasks which compile this source set.
public SourceDirectorySet getAllJava()
public SourceDirectorySet getAllSource()
@Deprecated public SourceSetOutput getClasses()
Returns SourceSetOutput that extends FileCollection which means that it provides all output directories (compiled classes, processed resources, etc.)
Provides a way to configure the default output dirs and specify additional output dirs - see SourceSetOutput
@Deprecated public java.io.File getClassesDir()
Returns the directory to assemble the compiled classes into.
public java.lang.String getClassesTaskName()
public FileCollection getCompileClasspath()
public java.lang.String getCompileJavaTaskName()
public java.lang.String getCompileTaskName(java.lang.String language)
language
- The language to be compiled.
public SourceDirectorySet getJava()
public java.lang.String getName()
public SourceSetOutput getOutput()
public java.lang.String getProcessResourcesTaskName()
public SourceDirectorySet getResources()
public FileCollection getRuntimeClasspath()
public java.lang.String getTaskName(java.lang.String verb, java.lang.String target)
verb
- The action, may be null.target
- The target, may be null
public SourceSet java(groovy.lang.Closure configureClosure)
The given closure is used to configure the SourceDirectorySet which contains the Java source.
configureClosure
- The closure to use to configure the Java source.
public SourceSet resources(groovy.lang.Closure configureClosure)
The given closure is used to configure the SourceDirectorySet which contains the resources.
configureClosure
- The closure to use to configure the resources.
@Deprecated public void setClassesDir(java.io.File classesDir)
Sets the directory to assemble the compiled classes into.
classesDir
- the classes dir. Should not be null.
public void setCompileClasspath(FileCollection classpath)
classpath
- The classpath. Should not be null.
public void setRuntimeClasspath(FileCollection classpath)
classpath
- The classpath. Should not be null.
Groovy Documentation