| API Documentation: | JavaPluginConvention |
|---|
Is mixed into the project when applying the JavaBasePlugin or the
JavaPlugin.
| Property | Description |
docsDir | Returns a file pointing to the root directory supposed to be used for all docs. |
docsDirName | The name of the docs directory. Can be a name or a path relative to the build dir. |
sourceCompatibility | The source compatibility used for compiling Java sources. |
sourceSets | The source sets container. |
targetCompatibility | The target compatibility used for compiling Java sources. |
testReportDir | Returns a file pointing to the root directory to be used for reports. |
testReportDirName | The name of the test reports directory. Can be a name or a path relative to |
testResultsDir | Returns a file pointing to the root directory of the test results. |
testResultsDirName | The name of the test results directory. Can be a name or a path relative to the build dir. |
| Block | Description |
sourceSets | Configures the source sets of this project. |
File docsDir (read-only)
Returns a file pointing to the root directory supposed to be used for all docs.
- Default with
javaplugin: ${project.buildDir}/${project.docsDirName}
String docsDirName
The name of the docs directory. Can be a name or a path relative to the build dir.
- Default with
javaplugin: 'docs'
JavaVersion sourceCompatibility
The source compatibility used for compiling Java sources.
- Default with
javaplugin: - Value of the current used JVM (e.g.
JavaVersion.JAVA_1_6on a 1.6 JVM).
SourceSetContainer sourceSets (read-only)
The source sets container.
JavaVersion targetCompatibility
The target compatibility used for compiling Java sources.
- Default with
javaplugin: project.sourceCompatibility
File testReportDir (read-only)
Returns a file pointing to the root directory to be used for reports.
- Default with
javaplugin: ${project.reporting.baseDir}/${project.testReportDirName}
String testReportDirName
The name of the test reports directory. Can be a name or a path relative to ReportingExtension.getBaseDir().
- Default with
javaplugin: 'tests'
File testResultsDir (read-only)
Returns a file pointing to the root directory of the test results.
- Default with
javaplugin: ${project.buildDir}/${project.testResultsDirName}
String testResultsDirName
The name of the test results directory. Can be a name or a path relative to the build dir.
- Default with
javaplugin: 'test-results'
Configures the source sets of this project.
The given closure is executed to configure the SourceSetContainer. The SourceSetContainer
is passed to the closure as its delegate.
See the example below how SourceSet 'main' is accessed and how the SourceDirectorySet 'java'
is configured to exclude some package from compilation.
apply plugin: 'java' sourceSets { main { java { exclude 'some/unwanted/package/**' } } }
- Delegates to:
SourceSetContainerfromsourceSets