Package org.gradle.api.plugins
Class JavaPluginConvention
java.lang.Object
org.gradle.api.plugins.JavaPluginConvention
Is mixed into the project when applying the
JavaBasePlugin
or the
JavaPlugin
.-
Constructor Summary
ConstructorDescriptionJavaPluginConvention
(org.gradle.api.internal.project.ProjectInternal project, org.gradle.internal.reflect.Instantiator instantiator) -
Method Summary
Modifier and TypeMethodDescriptionReturns a file pointing to the root directory supposed to be used for all docs.The name of the docs directory.org.gradle.api.internal.project.ProjectInternal
Returns the source compatibility used for compiling Java sources.The source sets container.Returns the target compatibility used for compiling Java sources.Returns a file pointing to the root directory to be used for reports.The name of the test reports directory.Returns a file pointing to the root directory of the test results.The name of the test results directory.manifest()
Creates a new instance of aManifest
.Creates and configures a new instance of aManifest
.Creates and configures a new instance of aManifest
.void
setDocsDirName
(String docsDirName) void
setSourceCompatibility
(Object value) Sets the source compatibility used for compiling Java sources.void
Sets the source compatibility used for compiling Java sources.void
setTargetCompatibility
(Object value) Sets the target compatibility used for compiling Java sources.void
Sets the target compatibility used for compiling Java sources.void
setTestReportDirName
(String testReportDirName) void
setTestResultsDirName
(String testResultsDirName) sourceSets
(Closure closure) Configures the source sets of this project.
-
Constructor Details
-
JavaPluginConvention
public JavaPluginConvention(org.gradle.api.internal.project.ProjectInternal project, org.gradle.internal.reflect.Instantiator instantiator)
-
-
Method Details
-
sourceSets
Configures the source sets of this project.The given closure is executed to configure the
SourceSetContainer
. TheSourceSetContainer
is passed to the closure as its delegate.See the example below how
SourceSet
'main' is accessed and how theSourceDirectorySet
'java' is configured to exclude some package from compilation.apply plugin: 'java' sourceSets { main { java { exclude 'some/unwanted/package/**' } } }
- Parameters:
closure
- The closure to execute.- Returns:
- NamedDomainObjectContainer<org.gradle.api.tasks.SourceSet>
-
getDocsDir
Returns a file pointing to the root directory supposed to be used for all docs. -
getTestResultsDir
Returns a file pointing to the root directory of the test results. -
getTestReportDir
Returns a file pointing to the root directory to be used for reports. -
getSourceCompatibility
Returns the source compatibility used for compiling Java sources. -
setSourceCompatibility
Sets the source compatibility used for compiling Java sources.- Parameters:
value
- The value for the source compatibility as defined byJavaVersion.toVersion(Object)
-
setSourceCompatibility
Sets the source compatibility used for compiling Java sources.- Parameters:
value
- The value for the source compatibility
-
getTargetCompatibility
Returns the target compatibility used for compiling Java sources. -
setTargetCompatibility
Sets the target compatibility used for compiling Java sources.- Parameters:
value
- The value for the target compatibility as defined byJavaVersion.toVersion(Object)
-
setTargetCompatibility
Sets the target compatibility used for compiling Java sources.- Parameters:
value
- The value for the target compatibility
-
manifest
Creates a new instance of aManifest
. -
manifest
Creates and configures a new instance of aManifest
. The given closure configures the new manifest instance before it is returned.- Parameters:
closure
- The closure to use to configure the manifest.
-
manifest
Creates and configures a new instance of aManifest
.- Parameters:
action
- The action to use to configure the manifest.- Since:
- 3.5
-
getDocsDirName
The name of the docs directory. Can be a name or a path relative to the build dir. -
setDocsDirName
-
getTestResultsDirName
The name of the test results directory. Can be a name or a path relative to the build dir. -
setTestResultsDirName
-
getTestReportDirName
The name of the test reports directory. Can be a name or a path relative toReportingExtension.getBaseDir()
. -
setTestReportDirName
-
getSourceSets
The source sets container. -
getProject
public org.gradle.api.internal.project.ProjectInternal getProject()
-