Source Set
A SourceSet
represents a logical group of Java source and resource files. They are covered in more detail in the user manual.
The following example shows how you can configure the 'main' source set, which in this case involves excluding classes whose package begins 'some.unwanted.package' from compilation of the source files in the 'java' SourceDirectorySet:
plugins {
id 'java'
}
sourceSets {
main {
java {
exclude 'some/unwanted/package/**'
}
}
}
Content copied to clipboard
Properties
Functions
Link copied to clipboard
Registers a set of tasks which are responsible for compiling this source set into the classes directory.
Link copied to clipboard
All Java source files for this source set.
Link copied to clipboard
All source files for this source set.
Link copied to clipboard
Returns the name of the configuration containing annotation processors and their dependencies needed to compile this source set.
Link copied to clipboard
Returns the classpath used to load annotation processors when compiling this source set.
Link copied to clipboard
Returns the name of the API configuration for this source set.
Link copied to clipboard
Returns the name of the configuration that should be used when compiling against the API of this component.
Link copied to clipboard
Returns the name of the classes task for this source set.
Link copied to clipboard
Returns the classpath used to compile this source.
Link copied to clipboard
Returns the name of the compile classpath configuration for this source set.
Link copied to clipboard
Returns the name of the compile Java task for this source set.
Link copied to clipboard
Returns the name of the 'compile only api' configuration for this source set.
Link copied to clipboard
Returns the name of the compile only configuration for this source set.
Link copied to clipboard
Returns the name of a compile task for this source set.
Link copied to clipboard
Link copied to clipboard
Returns the name of the implementation configuration for this source set.
Link copied to clipboard
Returns the name of the Jar task for this source set.
Link copied to clipboard
Returns the Java source which is to be compiled by the Java compiler into the class output directory.
Link copied to clipboard
Returns the name of the configuration that represents the variant that carries the Javadoc for this source set in packaged form.
Link copied to clipboard
Returns the name of the Javadoc Jar task for this source set.
Link copied to clipboard
Returns the name of the Javadoc task for this source set.
Link copied to clipboard
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.
Link copied to clipboard
Returns the name of the resource process task for this source set.
Link copied to clipboard
Returns the non-Java resources which are to be copied into the resources output directory.
Link copied to clipboard
Returns the classpath used to execute this source.
Link copied to clipboard
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.
Link copied to clipboard
Returns the name of the configuration containing elements that are strictly required at runtime.
Link copied to clipboard
Returns the name of the configuration that contains dependencies that are only required at runtime of the component.
Link copied to clipboard
Returns the name of the configuration that represents the variant that carries the original source code in packaged form.
Link copied to clipboard
Returns the name of the Source Jar task for this source set.
Link copied to clipboard
Returns the name of a task for this source set.
Link copied to clipboard
abstract fun java(@Nullable @DelegatesTo(value = SourceDirectorySet::class ) configureClosure: Closure): SourceSet
Configures the Java source for this set.
Link copied to clipboard
abstract fun resources(@Nullable @DelegatesTo(value = SourceDirectorySet::class ) configureClosure: Closure): SourceSet
Configures the non-Java resources for this set.
Link copied to clipboard
Set the classpath to use to load annotation processors when compiling this source set.
Link copied to clipboard
Sets the classpath used to compile this source.
Link copied to clipboard
Sets the classpath used to execute this source.
Link copied to clipboard
Returns the extension of the specified type.
Returns the extension of the specified extensionType.