public final class Runner extends Object
Sonar Runner class that can be used to launch Sonar analyses.
Configuration is all done through properties:
create(Properties, File)
constructor)setEnvironmentInformation(String, String)
method)Modifier and Type | Field and Description |
---|---|
static String |
DEF_VALUE_WORK_DIRECTORY
Default value of the working directory.
|
static String |
PROPERTY_ENVIRONMENT_INFORMATION_KEY
Property used to specify the name of the tool that will run a Sonar analysis.
|
static String |
PROPERTY_ENVIRONMENT_INFORMATION_VERSION
Property used to specify the version of the tool that will run a Sonar analysis.
|
static String |
PROPERTY_OLD_DEBUG_MODE
Deprecated.
Replaced by sonar.verbose since 1.2
|
static String |
PROPERTY_SONAR_PROJECT_BASEDIR
Property used to specify the base directory of the project to analyse.
|
static String |
PROPERTY_VERBOSE
Property used to increase logging information.
|
static String |
PROPERTY_WORK_DIRECTORY
Property used to specify the working directory for the runner.
|
Modifier and Type | Method and Description |
---|---|
void |
addContainerExtension(Object extension) |
protected void |
checkSonarVersion(org.sonar.runner.Bootstrapper bootstrapper) |
static Runner |
create(Properties props)
Creates a Runner based only on the given properties.
|
static Runner |
create(Properties props,
File basedir)
Creates a Runner based only on the properties and with the given base directory.
|
void |
execute()
Runs a Sonar analysis.
|
static URL |
getJarPath()
For unknown reasons
getClass().getProtectionDomain().getCodeSource().getLocation() doesn't work under Ant 1.7.0. |
File |
getProjectDir() |
protected Properties |
getProperties() |
String |
getSonarServerURL() |
String |
getSourceCodeEncoding() |
File |
getWorkDir() |
boolean |
isEncodingPlatformDependant() |
void |
setEnvironmentInformation(String key,
String version)
Allows to overwrite the environment information when Sonar Runner is embedded in a specific tool (for instance, with the Sonar Ant Task).
|
void |
setUnmaskedPackages(String... unmaskedPackages) |
@Deprecated public static final String PROPERTY_OLD_DEBUG_MODE
public static final String PROPERTY_VERBOSE
public static final String PROPERTY_WORK_DIRECTORY
public static final String DEF_VALUE_WORK_DIRECTORY
public static final String PROPERTY_SONAR_PROJECT_BASEDIR
public static final String PROPERTY_ENVIRONMENT_INFORMATION_KEY
public static final String PROPERTY_ENVIRONMENT_INFORMATION_VERSION
public static Runner create(Properties props)
public static Runner create(Properties props, File basedir)
public void execute()
public String getSonarServerURL()
public File getProjectDir()
public File getWorkDir()
public String getSourceCodeEncoding()
public boolean isEncodingPlatformDependant()
protected Properties getProperties()
protected void checkSonarVersion(org.sonar.runner.Bootstrapper bootstrapper)
public static URL getJarPath()
getClass().getProtectionDomain().getCodeSource().getLocation()
doesn't work under Ant 1.7.0.
So this is a workaround.public void setEnvironmentInformation(String key, String version)
key
- the key of the tool that embeds Sonar Runnerversion
- the version of this toolpublic void setUnmaskedPackages(String... unmaskedPackages)
public void addContainerExtension(Object extension)
Copyright © 2011–2018 SonarSource. All rights reserved.