Class JavaPluginConvention
java.lang.Object
org.gradle.api.plugins.JavaPluginConvention
Is mixed into the project when applying the
JavaBasePlugin or the
JavaPlugin.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidIf this method is called, Gradle will not automatically try to fetch dependencies which have a JVM version compatible with this module.abstract booleanTells if automatic JVM targetting is enabled.abstract FileReturns a file pointing to the root directory supposed to be used for all docs.abstract StringThe name of the docs directory.abstract org.gradle.api.internal.project.ProjectInternalabstract JavaVersionReturns the source compatibility used for compiling Java sources.abstract SourceSetContainerThe source sets container.abstract JavaVersionReturns the target compatibility used for compiling Java sources.abstract FileReturns a file pointing to the root directory to be used for reports.abstract StringThe name of the test reports directory.abstract FileReturns a file pointing to the root directory of the test results.abstract StringThe name of the test results directory.abstract Manifestmanifest()Creates a new instance of aManifest.abstract ManifestCreates and configures a new instance of aManifest.abstract ManifestCreates and configures a new instance of aManifest.abstract voidsetDocsDirName(String docsDirName) abstract voidsetSourceCompatibility(Object value) Sets the source compatibility used for compiling Java sources.abstract voidSets the source compatibility used for compiling Java sources.abstract voidsetTargetCompatibility(Object value) Sets the target compatibility used for compiling Java sources.abstract voidSets the target compatibility used for compiling Java sources.abstract voidsetTestReportDirName(String testReportDirName) abstract voidsetTestResultsDirName(String testResultsDirName) abstract ObjectsourceSets(Closure closure) Configures the source sets of this project.
-
Constructor Details
-
JavaPluginConvention
public JavaPluginConvention()
-
-
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 abstract org.gradle.api.internal.project.ProjectInternal getProject() -
disableAutoTargetJvm
If this method is called, Gradle will not automatically try to fetch dependencies which have a JVM version compatible with this module. This should be used whenever the default behavior is not applicable, in particular when for some reason it's not possible to split a module and that this module only has some classes which require dependencies on higher versions.- Since:
- 5.3
-
getAutoTargetJvmDisabled
Tells if automatic JVM targetting is enabled. When disabled, Gradle will not automatically try to get dependencies corresponding to the same (or compatible) level as the target compatibility of this module.- Since:
- 5.3
-