|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Object org.gradle.api.sonar.runner.SonarRunnerExtension
@Incubating class SonarRunnerExtension
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 } }
Property Summary | |
---|---|
boolean |
skipProject
Tells if the project will be excluded from analysis. |
Method Summary | |
---|---|
void
|
evaluateSonarPropertiesBlocks(Map properties)
|
void
|
sonarProperties(Action action)
Adds an action that configures Sonar properties for the associated Gradle project. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Property Detail |
---|
boolean skipProject
Method Detail |
---|
@PackageScope void evaluateSonarPropertiesBlocks(Map properties)
void sonarProperties(Action action)
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
Gradle API 1.12