public final class GradleJavaSourceSet extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
GradleJavaSourceSet.ClassPathType |
static class |
GradleJavaSourceSet.SourceType |
Modifier and Type | Field and Description |
---|---|
static String |
MAIN_SOURCESET_NAME |
static String |
TEST_SOURCESET_NAME |
static File |
UNKNOWN
Represents an unknown value.
|
Constructor and Description |
---|
GradleJavaSourceSet(String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(File f)
Returns
true if the given file belongs either to the sources or
the outputs of this SourceSet. |
boolean |
equals(Object obj) |
File |
findResource(String name)
Tries to find a resource given by its relative path name in the
directories associated with this SourceSet.
|
File |
findResource(String name,
boolean includeOutputs,
GradleJavaSourceSet.SourceType... types)
Tries to find a resource given by its relative path name in the
directories associated with this SourceSet.
|
Collection<File> |
getAllDirs() |
Collection<File> |
getAllDirs(boolean deduplicate)
Returns all possible configured source directories regardless
of their existence.
|
String |
getAnnotationProcessorConfigurationName()
The name of the annotation processor path configuration.
|
Set<File> |
getAnnotationProcessorPath()
The annotation processor path configured for this source set.
|
Collection<File> |
getAvailableDirs() |
Collection<File> |
getAvailableDirs(boolean deduplicate)
Returns all configured and existing source directories.
|
String |
getBuildTaskName(GradleJavaSourceSet.SourceType type) |
String |
getClassesTaskName() |
Set<File> |
getCompileClassPath() |
String |
getCompileConfigurationName()
Deprecated.
No replacement.
|
List<String> |
getCompilerArgs(GradleJavaSourceSet.SourceType type)
Returns the compiler arguments for this source set defined for the given
language.
|
String |
getCompileTaskName(String language) |
Set<File> |
getGeneratedSourcesDirs()
The directories where sources are generated, e.g.
|
Set<File> |
getGroovyDirs() |
Set<File> |
getJavaDirs() |
Set<File> |
getKotlinDirs() |
String |
getName() |
File |
getOutputClassDir(GradleJavaSourceSet.SourceType srcType)
Returns output directories for the given source type in the sourceset.
|
Set<File> |
getOutputClassDirs() |
File |
getOutputResources()
Return the directory of resources output.
|
String |
getProcessResourcesTaskName() |
Set<File> |
getResourcesDirs() |
Set<File> |
getRuntimeClassPath() |
String |
getRuntimeConfigurationName()
Deprecated.
No replacement.
|
Set<File> |
getScalaDirs() |
Set<GradleJavaSourceSet> |
getSourceDependencies()
Returns those SourceSets within this project which output is on our
compile/runtime classpath.
|
Set<File> |
getSourceDirs(GradleJavaSourceSet.SourceType type) |
String |
getSourcesCompatibility()
|
String |
getSourcesCompatibility(GradleJavaSourceSet.SourceType type)
This method returns the source compatibility defined for this source
set for the given language type.
|
GradleJavaSourceSet.SourceType |
getSourceType(File f)
Returns the
GradleJavaSourceSet.SourceType of the given file or null if that
file cannot be associated with one. |
Set<GradleJavaSourceSet.SourceType> |
getSourceTypes(File f) |
String |
getTargetCompatibility()
|
String |
getTargetCompatibility(GradleJavaSourceSet.SourceType type)
This method returns the target compatibility defined for this source
set for the given language type.
|
String |
getTaskName(String verb,
String target) |
int |
hashCode() |
boolean |
hasOverlappingSourceDirs() |
boolean |
isTestSourceSet() |
boolean |
outputContains(File f)
Checks if a file most probably belongs to the output of this source set.
|
String |
relativePath(File f) |
String |
toString() |
public static final String MAIN_SOURCESET_NAME
public static final String TEST_SOURCESET_NAME
public static final File UNKNOWN
public GradleJavaSourceSet(String name)
public String getName()
public boolean isTestSourceSet()
@Deprecated public String getSourcesCompatibility()
GradleJavaSourceSet.getSourcesCompatibility(org.netbeans.modules.gradle.java.api.GradleJavaSourceSet.SourceType)
instead.public String getSourcesCompatibility(GradleJavaSourceSet.SourceType type)
type
- @Deprecated public String getTargetCompatibility()
GradleJavaSourceSet.getTargetCompatibility(org.netbeans.modules.gradle.java.api.GradleJavaSourceSet.SourceType)
instead.public String getTargetCompatibility(GradleJavaSourceSet.SourceType type)
type
- @Deprecated public String getRuntimeConfigurationName()
null
from Gradle 7.0 as the
corresponding method has been removed in that version.null
if that's not available.@Deprecated public String getCompileConfigurationName()
null
from Gradle 7.0 as the
corresponding method has been removed in that version.null
if that's not available.public String getAnnotationProcessorConfigurationName()
public Set<File> getSourceDirs(GradleJavaSourceSet.SourceType type)
public Set<File> getGeneratedSourcesDirs()
public final Collection<File> getAllDirs(boolean deduplicate)
deduplicate
- public final Collection<File> getAllDirs()
public final Collection<File> getAvailableDirs(boolean deduplicate)
public final Collection<File> getAvailableDirs()
public Set<File> getAnnotationProcessorPath()
public GradleJavaSourceSet.SourceType getSourceType(File f)
GradleJavaSourceSet.SourceType
of the given file or null
if that
file cannot be associated with one.f
- the file to check.GradleJavaSourceSet.SourceType
or null
.public boolean hasOverlappingSourceDirs()
public Set<GradleJavaSourceSet.SourceType> getSourceTypes(File f)
public boolean outputContains(File f)
f
- a filepublic File getOutputClassDir(GradleJavaSourceSet.SourceType srcType)
srcType
- language typenull
.public File getOutputResources()
null
.public Set<GradleJavaSourceSet> getSourceDependencies()
public boolean contains(File f)
true
if the given file belongs either to the sources or
the outputs of this SourceSet. Due to practical consideration if the
project is a war project and this SourceSet is the main SourceSet then
the content of the project 'webapp' folder is also associated with this
SourceSet.f
- the file to testtrue
if the given file can be associated with this
SourceSetpublic File findResource(String name)
name
- the name of the resources, use "/" as separator character.null
if no such resource can be associated with this SourceSet.public File findResource(String name, boolean includeOutputs, GradleJavaSourceSet.SourceType... types)
name
- the name of the resources, use "/" as separator character.includeOutputs
- include the outputs (classes and resources) in the searchtypes
- Source types to check, if omitted, all source types will be included.null
if no such resource can be associated with this SourceSet.public String getBuildTaskName(GradleJavaSourceSet.SourceType type)
public List<String> getCompilerArgs(GradleJavaSourceSet.SourceType type)
type
- public String getProcessResourcesTaskName()
public String getClassesTaskName()