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/**' } } }
static val MAIN_SOURCE_SET_NAME: String
The name of the main source set. |
|
static val TEST_SOURCE_SET_NAME: String
The name of the test source set. |
abstract fun compiledBy(vararg taskPaths: Any): SourceSet
Registers a set of tasks which are responsible for compiling this source set into the classes directory. The paths are evaluated as per |
|
abstract fun getAllJava(): SourceDirectorySet
All Java source files for this source set. This includes, for example, source which is directly compiled, and source which is indirectly compiled through joint compilation. |
|
abstract fun getAllSource(): SourceDirectorySet
All source files for this source set. |
|
abstract fun getAnnotationProcessorConfigurationName(): String
Returns the name of the configuration containing annotation processors and their dependencies needed to compile this source set. |
|
abstract fun getAnnotationProcessorPath(): FileCollection
Returns the classpath used to load annotation processors when compiling this source set. This path is also used for annotation processor discovery. The classpath can be empty, which means use the compile classpath; if you want to disable annotation processing, then use |
|
abstract fun getApiConfigurationName(): String
Returns the name of the API configuration for this source set. The API configuration contains dependencies which are exported by this source set, and is not transitive by default. This configuration is not meant to be resolved and should only contain dependencies that are required when compiling against this component. |
|
abstract fun getApiElementsConfigurationName(): String
Returns the name of the configuration that should be used when compiling against the API of this component. This configuration is meant to be consumed by other components when they need to compile against it. |
|
abstract fun getClassesTaskName(): String
Returns the name of the classes task for this source set. |
|
abstract fun getCompileClasspath(): FileCollection
Returns the classpath used to compile this source. |
|
abstract fun getCompileClasspathConfigurationName(): String
Returns the name of the compile classpath configuration for this source set. |
|
abstract fun getCompileConfigurationName(): String
Returns the name of the compile configuration for this source set. |
|
abstract fun getCompileJavaTaskName(): String
Returns the name of the compile Java task for this source set. |
|
abstract fun getCompileOnlyConfigurationName(): String
Returns the name of the compile only configuration for this source set. |
|
abstract fun getCompileTaskName(language: String): String
Returns the name of a compile task for this source set. |
|
abstract fun getImplementationConfigurationName(): String
Returns the name of the implementation configuration for this source set. The implementation configuration should contain dependencies which are specific to the implementation of the component (internal APIs). |
|
abstract fun getJarTaskName(): String
Returns the name of the Jar task for this source set. |
|
abstract fun getJava(): SourceDirectorySet
Returns the Java source which is to be compiled by the Java compiler into the class output directory. |
|
abstract fun getName(): String
Returns the name of this source set. |
|
abstract fun getOutput(): SourceSetOutput
SourceSetOutput is a FileCollection of all output directories (compiled classes, processed resources, etc.) and it provides means to configure the default output dirs and register additional output dirs. See examples in SourceSetOutput |
|
abstract fun getProcessResourcesTaskName(): String
Returns the name of the resource process task for this source set. |
|
abstract fun getResources(): SourceDirectorySet
Returns the non-Java resources which are to be copied into the resources output directory. |
|
abstract fun getRuntimeClasspath(): FileCollection
Returns the classpath used to execute this source. |
|
abstract fun getRuntimeClasspathConfigurationName(): String
Returns the name of the runtime classpath configuration of this component: the runtime classpath contains elements of the implementation, as well as runtime only elements. |
|
abstract fun getRuntimeConfigurationName(): String
Returns the name of the runtime configuration for this source set. |
|
abstract fun getRuntimeElementsConfigurationName(): String
Returns the name of the configuration containing elements that are stricly required at runtime. Consumers of this configuration will get all the mandatory elements for this component to execute at runtime. |
|
abstract fun getRuntimeOnlyConfigurationName(): String
Returns the name of the configuration that contains dependencies that are only required at runtime of the component. Dependencies found in this configuration are visible to the runtime classpath of the component, but not to consumers. |
|
abstract fun getTaskName(verb: String, target: String): String
Returns the name of a task for this source set. |
|
abstract fun java(configureClosure: Closure<Any>): SourceSet
Configures the Java source for this set. The given closure is used to configure the SourceDirectorySet which contains the Java source. abstract fun java(configureAction: Action<in SourceDirectorySet>): SourceSet
Configures the Java source for this set. The given action is used to configure the SourceDirectorySet which contains the Java source. |
|
abstract fun resources(configureClosure: Closure<Any>): SourceSet
Configures the non-Java resources for this set. The given closure is used to configure the SourceDirectorySet which contains the resources. abstract fun resources(configureAction: Action<in SourceDirectorySet>): SourceSet
Configures the non-Java resources for this set. The given action is used to configure the SourceDirectorySet which contains the resources. |
|
abstract fun setAnnotationProcessorPath(annotationProcessorPath: FileCollection): Unit
Set the classpath to use to load annotation processors when compiling this source set. This path is also used for annotation processor discovery. The classpath can be empty, which means use the compile classpath; if you want to disable annotation processing, then use |
|
abstract fun setCompileClasspath(classpath: FileCollection): Unit
Sets the classpath used to compile this source. |
|
abstract fun setRuntimeClasspath(classpath: FileCollection): Unit
Sets the classpath used to execute this source. |
val SourceSet.ext: ExtraPropertiesExtension
Retrieves the ext extension. |
fun SourceSet.ext(configure: ExtraPropertiesExtension.() -> Unit): Unit
Configures the ext extension. |