Groovy Documentation

org.gradle.api.tasks
Interface SourceSet


interface SourceSet

A SourceSet represents a logical group of Java source and resources.


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.

FileTree getAllJava()

All Java source for this source set.

FileTree getAllSource()

All source for this source set.

FileCollection getClasses()

Returns the compiled classes directory for this source set.

File getClassesDir()

Returns the directory to assemble the compiled classes into.

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

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.

SourceSet java(Closure configureClosure)

Configures the Java source for this set.

SourceSet resources(Closure configureClosure)

Configures the non-Java resources for this set.

void setClassesDir(File classesDir)

Sets the directory to assemble the compiled classes into.

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

MAIN_SOURCE_SET_NAME

java.lang.String MAIN_SOURCE_SET_NAME
The name of the main source set.


TEST_SOURCE_SET_NAME

java.lang.String TEST_SOURCE_SET_NAME
The name of the test source set.


 
Method Detail

compiledBy

public SourceSet compiledBy(java.lang.Object taskPaths)
Registers a set of tasks which are responsible for compiling this source set into the classes directory. The paths are evaluated as for org.gradle.api.Task#dependsOn(Object...).
param:
taskPaths The tasks which compile this source set.
return:
this


getAllJava

public FileTree getAllJava()
All Java source for this source set. This includes, for example, source which is directly compiled, and source which is indirectly compiled through joint compilation.
return:
the Java source. Never returns null.


getAllSource

public FileTree getAllSource()
All source for this source set.
return:
the source. Never returns null.


getClasses

public FileCollection getClasses()
Returns the compiled classes directory for this source set.
return:
The classes dir, as a FileCollection.


getClassesDir

public File getClassesDir()
Returns the directory to assemble the compiled classes into.
return:
The classes dir. Never returns null.


getClassesTaskName

public java.lang.String getClassesTaskName()
Returns the name of the classes task for this source set.
return:
The task name. Never returns null.


getCompileClasspath

public FileCollection getCompileClasspath()
Returns the classpath used to compile this source.
return:
The classpath. Never returns null.


getCompileTaskName

public java.lang.String getCompileTaskName(java.lang.String language)
Returns the name of a compile task for this source set.
param:
language The language to be compiled.
return:
The task name. Never returns null.


getJava

public SourceDirectorySet getJava()
Returns the Java source which is to be compiled by the Java compiler into the class output directory.
return:
the Java source. Never returns null.


getName

public java.lang.String getName()
Returns the name of this source set.
return:
The name. Never returns null.


getProcessResourcesTaskName

public java.lang.String getProcessResourcesTaskName()
Returns the name of the resource process task for this source set.
return:
The task name. Never returns null.


getResources

public SourceDirectorySet getResources()
Returns the non-Java resources which are to be copied into the class output directory.
return:
the resources. Never returns null.


getRuntimeClasspath

public FileCollection getRuntimeClasspath()
Returns the classpath used to execute this source.
return:
The classpath. Never returns null.


java

public SourceSet java(Closure configureClosure)
Configures the Java source for this set. The given closure is used to configure the SourceDirectorySet which contains the Java source.
param:
configureClosure The closure to use to configure the Java source.
return:
this


resources

public SourceSet resources(Closure configureClosure)
Configures the non-Java resources for this set. The given closure is used to configure the SourceDirectorySet which contains the resources.
param:
configureClosure The closure to use to configure the resources.
return:
this


setClassesDir

public void setClassesDir(File classesDir)
Sets the directory to assemble the compiled classes into.
param:
classesDir the classes dir. Should not be null.


setCompileClasspath

public void setCompileClasspath(FileCollection classpath)
Sets the classpath used to compile this source.
param:
classpath The classpath. Should not be null.


setRuntimeClasspath

public void setRuntimeClasspath(FileCollection classpath)
Sets the classpath used to execute this source.
param:
classpath The classpath. Should not be null.


 

Groovy Documentation