Package org.gradle.api.plugins
Class JavaPluginConvention
- java.lang.Object
-
- org.gradle.api.plugins.JavaPluginConvention
-
public class JavaPluginConvention extends Object
Is mixed into the project when applying theJavaBasePluginor theJavaPlugin.
-
-
Constructor Summary
Constructors Constructor Description JavaPluginConvention(org.gradle.api.internal.project.ProjectInternal project, org.gradle.internal.reflect.Instantiator instantiator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegetDocsDir()Returns a file pointing to the root directory supposed to be used for all docs.StringgetDocsDirName()The name of the docs directory.org.gradle.api.internal.project.ProjectInternalgetProject()JavaVersiongetSourceCompatibility()Returns the source compatibility used for compiling Java sources.SourceSetContainergetSourceSets()The source sets container.JavaVersiongetTargetCompatibility()Returns the target compatibility used for compiling Java sources.FilegetTestReportDir()Returns a file pointing to the root directory to be used for reports.StringgetTestReportDirName()The name of the test reports directory.FilegetTestResultsDir()Returns a file pointing to the root directory of the test results.StringgetTestResultsDirName()The name of the test results directory.Manifestmanifest()Creates a new instance of aManifest.Manifestmanifest(Closure closure)Creates and configures a new instance of aManifest.Manifestmanifest(Action<? super Manifest> action)Creates and configures a new instance of aManifest.voidsetDocsDirName(String docsDirName)voidsetSourceCompatibility(Object value)Sets the source compatibility used for compiling Java sources.voidsetSourceCompatibility(JavaVersion value)Sets the source compatibility used for compiling Java sources.voidsetTargetCompatibility(Object value)Sets the target compatibility used for compiling Java sources.voidsetTargetCompatibility(JavaVersion value)Sets the target compatibility used for compiling Java sources.voidsetTestReportDirName(String testReportDirName)voidsetTestResultsDirName(String testResultsDirName)ObjectsourceSets(Closure closure)Configures the source sets of this project.
-
-
-
Method Detail
-
sourceSets
public Object sourceSets(Closure closure)
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
public File getDocsDir()
Returns a file pointing to the root directory supposed to be used for all docs.
-
getTestResultsDir
public File getTestResultsDir()
Returns a file pointing to the root directory of the test results.
-
getTestReportDir
public File getTestReportDir()
Returns a file pointing to the root directory to be used for reports.
-
getSourceCompatibility
public JavaVersion getSourceCompatibility()
Returns the source compatibility used for compiling Java sources.
-
setSourceCompatibility
public void setSourceCompatibility(Object value)
Sets the source compatibility used for compiling Java sources.- Parameters:
value- The value for the source compatibility as defined byJavaVersion.toVersion(Object)
-
setSourceCompatibility
public void setSourceCompatibility(JavaVersion value)
Sets the source compatibility used for compiling Java sources.- Parameters:
value- The value for the source compatibility
-
getTargetCompatibility
public JavaVersion getTargetCompatibility()
Returns the target compatibility used for compiling Java sources.
-
setTargetCompatibility
public void setTargetCompatibility(Object value)
Sets the target compatibility used for compiling Java sources.- Parameters:
value- The value for the target compatibility as defined byJavaVersion.toVersion(Object)
-
setTargetCompatibility
public void setTargetCompatibility(JavaVersion value)
Sets the target compatibility used for compiling Java sources.- Parameters:
value- The value for the target compatibility
-
manifest
public Manifest manifest(Closure closure)
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
public Manifest manifest(Action<? super Manifest> action)
Creates and configures a new instance of aManifest.- Parameters:
action- The action to use to configure the manifest.- Since:
- 3.5
-
getDocsDirName
public String getDocsDirName()
The name of the docs directory. Can be a name or a path relative to the build dir.
-
setDocsDirName
public void setDocsDirName(String docsDirName)
-
getTestResultsDirName
public String getTestResultsDirName()
The name of the test results directory. Can be a name or a path relative to the build dir.
-
setTestResultsDirName
public void setTestResultsDirName(String testResultsDirName)
-
getTestReportDirName
public String getTestReportDirName()
The name of the test reports directory. Can be a name or a path relative toReportingExtension.getBaseDir().
-
setTestReportDirName
public void setTestReportDirName(String testReportDirName)
-
getSourceSets
public SourceSetContainer getSourceSets()
The source sets container.
-
getProject
public org.gradle.api.internal.project.ProjectInternal getProject()
-
-