An extension for configuring the
Sonar Runner. The extension is added to all projects that have the sonar-runner
plugin applied, and all of their subprojects.
Example usage:
sonarRunner { skipProject = false // this is the default sonarProperties { property "sonar.host.url", "http://my.sonar.server" // adding a single property properties mapOfProperties // adding multiple properties at once properties["sonar.sources"] += sourceSets.other.java.srcDirs // manipulating an existing property } }
Type | Name and description |
---|---|
void |
evaluateSonarPropertiesBlocks(Map<String, Object> properties) |
void |
sonarProperties(Action<? super SonarProperties> action) Adds an action that configures Sonar properties for the associated Gradle project. |
Tells if the project will be excluded from analysis. Defaults to false
.
Adds an action that configures Sonar properties for the associated Gradle project.
Global Sonar properties (e.g. database connection settings) have to be set on the
"root" project of the Sonar run. This is the project that has the sonar-runner
plugin applied.
The action is passed an instance of SonarProperties
.
Evaluation of the action is deferred until sonarRunner.sonarProperties
is requested.
Hence it is safe to reference other Gradle model properties from inside the action.
Sonar properties can also be set via system properties (and therefore from the command line).
This is mainly useful for global Sonar properties like database credentials.
Every system property starting with "sonar."
is automatically set on the "root" project of the
Sonar run (i.e. the project that has the sonar-runner
plugin applied). System properties take
precedence over properties declared in build scripts.
action
- an action that configures Sonar properties for the associated Gradle project