|
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 | |
---|---|
String |
MAIN_SOURCE_SET_NAME
The name of the main source set. |
String |
TEST_SOURCE_SET_NAME
The name of the test source set. |
Method Summary | |
---|---|
SourceSet
|
compiledBy(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. |
String
|
getClassesTaskName()
Returns the name of the classes task for this source set. |
FileCollection
|
getCompileClasspath()
Returns the classpath used to compile this source. |
String
|
getCompileConfigurationName()
Returns the name of the compile configuration for this source set. |
String
|
getCompileJavaTaskName()
Returns the name of the compile Java task for this source set. |
String
|
getCompileTaskName(String language)
Returns the name of a compile task for this source set. |
String
|
getJarTaskName()
Returns the name of the Jar task for this source set, if such a task exists. |
SourceDirectorySet
|
getJava()
Returns the Java source which is to be compiled by the Java compiler into the class output directory. |
String
|
getName()
Returns the name of this source set. |
SourceSetOutput
|
getOutput()
SourceSetOutput is a FileCollection of all output directories (compiled classes, processed resources, etc.) |
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 resources output directory. |
FileCollection
|
getRuntimeClasspath()
Returns the classpath used to execute this source. |
String
|
getRuntimeConfigurationName()
Returns the name of the runtime configuration for this source set. |
String
|
getTaskName(String verb, String target)
Returns the name of a task for this source set. |
SourceSet
|
java(Closure configureClosure)
Configures the Java source for this set. |
SourceSet
|
resources(Closure configureClosure)
Configures the non-Java resources for this set. |
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 String MAIN_SOURCE_SET_NAME
public String TEST_SOURCE_SET_NAME
Method Detail |
---|
public SourceSet compiledBy(Object... taskPaths)
taskPaths
- The tasks which compile this source set.
public SourceDirectorySet getAllJava()
public SourceDirectorySet getAllSource()
public String getClassesTaskName()
public FileCollection getCompileClasspath()
public String getCompileConfigurationName()
public String getCompileJavaTaskName()
public String getCompileTaskName(String language)
language
- The language to be compiled.
public String getJarTaskName()
public SourceDirectorySet getJava()
public String getName()
public SourceSetOutput getOutput()
public String getProcessResourcesTaskName()
public SourceDirectorySet getResources()
public FileCollection getRuntimeClasspath()
public String getRuntimeConfigurationName()
public String getTaskName(String verb, String target)
verb
- The action, may be null.target
- The target, may be null
public SourceSet java(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(Closure configureClosure)
The given closure is used to configure the SourceDirectorySet which contains the resources.
configureClosure
- The closure to use to configure the resources.
public void setCompileClasspath(FileCollection classpath)
classpath
- The classpath. Should not be null.
public void setRuntimeClasspath(FileCollection classpath)
classpath
- The classpath. Should not be null.
Gradle API 1.12