Class JavaPluginConvention
java.lang.Object
org.gradle.api.plugins.JavaPluginConvention
Is mixed into the project when applying the
JavaBasePlugin or the
JavaPlugin.-
Constructor Summary
ConstructorsConstructorDescriptionJavaPluginConvention(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.ProjectInternalReturns 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.voidsetDocsDirName(String docsDirName) voidsetSourceCompatibility(Object value) Sets the source compatibility used for compiling Java sources.voidSets the source compatibility used for compiling Java sources.voidsetTargetCompatibility(Object value) Sets the target compatibility used for compiling Java sources.voidSets the target compatibility used for compiling Java sources.voidsetTestReportDirName(String testReportDirName) voidsetTestResultsDirName(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. TheSourceSetContaineris 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
-
manifest
-
manifest
-
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()
-