Per-project configuration options.
Type | Name and description |
---|---|
File |
baseDir The base directory for the analysis. |
List<File> |
binaryDirs The directories containing the project's compiled code to be analyzed. |
File |
cloverReportPath The Clover XML report file. |
File |
coberturaReportPath The Cobertura XML report file. |
String |
date The date when analysis was performed. |
String |
description A description for the project. |
String |
dynamicAnalysis Whether and how to perform dynamic analysis. |
boolean |
importSources Tells whether to the project's source code should be stored and made available via the Sonar web interface. |
SonarJavaSettings |
java Java-related configuration options. |
String |
key The identifier for the project. |
String |
language The programming language to be analyzed. |
FileCollection |
libraries A class path containing the libraries used by this project. |
String |
name The name for the project. |
List<Closure> |
propertyProcessors Post-processors for per-project Sonar properties. |
boolean |
skip Tells whether to skip analysis of this project. |
boolean |
skipDesignAnalysis Tells whether to skip analysis of the project's design. |
List<File> |
sourceDirs The directories containing the project's production source code to be analyzed. |
String |
sourceEncoding The character encoding for the project's source files. |
String |
sourceExclusions Source files to be excluded from analysis. |
List<File> |
testDirs The directories containing the project's test source code to be analyzed. |
File |
testReportPath The directory containing the JUnit XML test report. |
String |
version The version of the project. |
File |
workDir The working directory for the analysis. |
Type | Name and description |
---|---|
void |
java(Closure config) Configures Java-related configuration options. |
void |
withProjectProperties(Closure block) Registers a closure for post-processing the per-project Sonar properties covered by SonarProjectModel, and for adding further properties not covered by that model. |
The base directory for the analysis. Defaults to $project.projectDir.
The directories containing the project's compiled code to be analyzed. Defaults to main.output.classesDir.
The Clover XML report file. Defaults to null.
The Cobertura XML report file. Defaults to null.
The date when analysis was performed. Format is yyyy-MM-dd (e.g. 2010-12-25). Defaults to the current date.
A description for the project. Defaults to $project.description.
Whether and how to perform dynamic analysis. Dynamic analysis includes the analysis of test and code coverage reports. The following values are allowed:
Tells whether to the project's source code should be stored and made available via the Sonar web interface. Defaults to true.
Java-related configuration options.
The identifier for the project. Defaults to $project.group:$project.name.
The programming language to be analyzed. Only one language per project can be analyzed. Defaults to java.
A class path containing the libraries used by this project. Defaults to project.sourceSets.main.compileClasspath + Jvm.current().runtimeJar.
The name for the project. Defaults to $project.name.
Post-processors for per-project Sonar properties.
Tells whether to skip analysis of this project. Allows to only analyze a subset of projects in a Gradle build. Defaults to false.
Tells whether to skip analysis of the project's design. Defaults to false.
The directories containing the project's production source code to be analyzed. Defaults to project.sourceSets.main.allSource.srcDirs.
The character encoding for the project's source files. Accepts the same values as Charset (e.g. UTF-8, MacRoman, Shift_JIS). Defaults to the JVM's platform encoding.
Source files to be excluded from analysis. Specified as comma-separated list of Ant-style patterns which are relative to a source directory.
Example: com/mycompany/*/.java, **/*Dummy.java.
Defaults to null.
The directories containing the project's test source code to be analyzed. Defaults to project.sourceSets.test.allSource.srcDirs.
The directory containing the JUnit XML test report. Defaults to project.test.testResultsDir.
The version of the project. Defaults to $project.version.
The working directory for the analysis. Defaults to $project.buildDir/sonar.
Configures Java-related configuration options. The specified closure delegates to an instance of type SonarJavaSettings.
config
- Java-related configuration optionsRegisters a closure for post-processing the per-project Sonar properties covered by SonarProjectModel, and for adding further properties not covered by that model. The properties are passed to the closure as a map of String keys and values. Keys correspond to the Sonar properties as described in the Sonar documentation.
Evaluation of the closure is deferred until build execution time. If this method is called multiple times, closures will be evaluated in the order they have been registered.
Example:
withProjectProperties { props -> // add further properties props["some.sonar.property"] = "some value" props["another.sonar.property"] = "another value" // modify existing properties (rarely necessary) props["sonar.sourceEncoding"] = "UTF-8" props.remove("sonar.projectDate") }
block
- a closure for post-processing per-project Sonar properties