| API Documentation: | Sonar |
|---|
Analyzes a project and stores the results in Sonar's database.
| Property | Description |
bootstrapDir | The directory to be used for caching files downloaded from the Sonar server. |
projectClassesDirs | The directories containing the class files of the project to be analyzed. |
projectDependencies | The dependencies of the project to be analyzed. Typically these will be Jar files. |
projectDescription | The description of the project to be analyzed. |
projectDir | The base directory for the project to be analyzed. |
projectKey | A unique key for identifying the project to be analyzed. |
projectMainSourceDirs | The directories containing the production sources of the project to be analyzed. |
projectName | The name of the project to be analyzed. |
projectProperties | Project-specific properties for use by the Sonar code analyzer. |
projectTestSourceDirs | The directories containing the test sources of the project to be analyzed. |
projectVersion | The version of the project to be analyzed. |
serverUrl | The Sonar server to connect to. |
File bootstrapDir
The directory to be used for caching files downloaded from the Sonar server.
- Default with
sonarandjavaplugins: - Gradle-managed per-project cache directory
The directories containing the class files of the project to be analyzed.
- Default with
sonarandjavaplugins: project.sourceSets.main.classesDir
The dependencies of the project to be analyzed. Typically these will be Jar files.
- Default with
sonarandjavaplugins: project.configurations.compile.resolve()
String projectDescription
The description of the project to be analyzed.
- Default with
sonarandjavaplugins: project.description
File projectDir
The base directory for the project to be analyzed.
- Default with
sonarandjavaplugins: project.projectDir
String projectKey
A unique key for identifying the project to be analyzed.
- Default with
sonarandjavaplugins: $project.group:$project.name
The directories containing the production sources of the project to be analyzed.
- Default with
sonarandjavaplugins: project.sourceSets.main.java.srcDirs
String projectName
The name of the project to be analyzed.
- Default with
sonarandjavaplugins: project.name
Map projectProperties
Project-specific properties for use by the Sonar code analyzer.
- Default with
sonarandjavaplugins: -
["sonar.java.source": project.sourceCompatibility, "sonar.java.target": project.targetCompatibility, "sonar.dynamicAnalysis": "reuseReports", "sonar.surefire.reportsPath": project.test.testResultsDir]
The directories containing the test sources of the project to be analyzed.
- Default with
sonarandjavaplugins: -
project.sourceSets.main.java.srcDirs
String projectVersion
The version of the project to be analyzed.
- Default with
sonarandjavaplugins: project.version
String serverUrl
The Sonar server to connect to.
- Default with
sonarandjavaplugins: http://localhost:9000
| Method | Description |
globalProperties(properties) | Adds the specified properties to the map of global properties. Existing properties with the same name will be overwritten. |
globalProperty(name, value) | Adds the specified property to the map of global properties. If a property with the specified name already exists, it will be overwritten. |
projectClassesDir(classesDir) | Adds the specified directory to the set of project classes directories. |
projectClassesDirs(classesDirs) | Adds the specified directories to the set of project classes directories. |
projectDependencies(dependencies) | Adds the specified dependencies to the set of project dependencies. Typically these will be Jar files. |
projectDependency(dependency) | Adds the specified dependency to the set of project dependencies. Typically this will be a Jar file. |
projectMainSourceDir(sourceDir) | Adds the specified directory to the set of project main source directories. |
projectMainSourceDirs(sourceDirs) | Adds the specified directories to the set of project main source directories. |
projectProperties(properties) | Adds the specified properties to the map of project properties. Existing properties with the same name will be overwritten. |
projectProperty(name, value) | Adds the specified property to the map of project properties. If a property with the specified name already exists, it will be overwritten. |
projectTestSourceDir(sourceDir) | Adds the specified directory to the set of project test source directories. |
projectTestSourceDirs(sourceDirs) | Adds the specified directories to the set of project test source directories. |
void globalProperties(Map properties)
Adds the specified properties to the map of global properties. Existing properties with the same name will be overwritten.
Adds the specified property to the map of global properties. If a property with the specified name already exists, it will be overwritten.
void projectClassesDir(File classesDir)
Adds the specified directory to the set of project classes directories.
void projectClassesDirs(File... classesDirs)
File...Adds the specified directories to the set of project classes directories.
void projectDependencies(File... dependencies)
File...Adds the specified dependencies to the set of project dependencies. Typically these will be Jar files.
void projectDependency(File dependency)
Adds the specified dependency to the set of project dependencies. Typically this will be a Jar file.
void projectMainSourceDir(File sourceDir)
Adds the specified directory to the set of project main source directories.
void projectMainSourceDirs(File... sourceDirs)
File...Adds the specified directories to the set of project main source directories.
void projectProperties(Map properties)
Adds the specified properties to the map of project properties. Existing properties with the same name will be overwritten.
Adds the specified property to the map of project properties. If a property with the specified name already exists, it will be overwritten.
void projectTestSourceDir(File sourceDir)
Adds the specified directory to the set of project test source directories.
void projectTestSourceDirs(File... sourceDirs)
File...Adds the specified directories to the set of project test source directories.