public final class SonargraphBuildRunner extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SonargraphBuildRunner.Builder |
Modifier and Type | Method and Description |
---|---|
ServiceResponse |
close()
Close the software system
|
ServiceResponse |
createReport(File reportDir,
String reportFileName,
String reportType,
String reportFormats)
Create a report of the currently open system.
|
ServiceResponse |
createSnapshot(File snapshotDir,
String snapshotFileName) |
ServiceResponse |
failIfExists(FailSet filterSet) |
ServiceResponse |
getAutomatedScriptExecutionStatus() |
static void |
logInfo(String msg) |
static void |
main(String[] args)
Executes the following actions:
Starts SonargraphBuild
Opens software system
Refreshes software system
Sets virtual model
Creates report
Creates snapshot if at least one of snapshotDirectory or snapshotFileName are specified
Checks for issues (if specified)
Terminates normally, if no error occurs during operation.
|
ServiceResponse |
open(String systemDir,
String workspaceProfile)
Open the specified software system.
|
ServiceResponse |
refresh()
Refresh the opened software system
|
static void |
setInfoLogger(ILogger logger) |
ServiceResponse |
setVirtualModel(String virtualModel) |
static boolean |
shouldCreateSnapshot(String snapshotDir,
String snapshotFileName)
Don't create snapshot if both parameters are empty
|
ServiceResponse |
start()
Start the SonargraphBuild application.
|
ServiceResponse |
stop()
Stop the SonargraphBuild instance.
|
static void |
validateReportFormat(String reportFormat) |
static void |
validateReportType(String reportType) |
public static void setInfoLogger(ILogger logger)
public static void logInfo(String msg)
public ServiceResponse start()
ServiceResponse
containing status info.public ServiceResponse stop()
ServiceResponse
containing status info.public ServiceResponse open(String systemDir, String workspaceProfile)
systemDir
- the directory of the software system.workspaceProfile
- the workspace profile to be used (can be null)ServiceResponse
containing status info.public ServiceResponse getAutomatedScriptExecutionStatus()
public ServiceResponse refresh()
ServiceResponse
containing status info.public ServiceResponse failIfExists(FailSet filterSet)
public ServiceResponse setVirtualModel(String virtualModel)
public ServiceResponse close()
ServiceResponse
indicating success or failure.public ServiceResponse createReport(File reportDir, String reportFileName, String reportType, String reportFormats)
reportDir
- target directory of the generated report.reportFileName
- the file name of the report to be generated. If null or empty, <system-name>_<timestamp> is used.reportType
- name of one of ISonargraphBuild.ReportType
enum.reportFormats
- one or several of ISonargraphBuild.ReportFormat
enum, separated by ",".ServiceResponse
indicating success or failure.public ServiceResponse createSnapshot(File snapshotDir, String snapshotFileName)
public static void main(String[] args)
<sonargraphBuild
activationCode="_your activation code_"
licenseFileLocation="path to your license file"
languages="Java"
installationDirectory="../.."
systemDirectory="../javaProject/AlarmClock.sonargraph"
virtualModel="Modifiable.vm"
reportDirectory="./_temp/report"
reportFileName=""
reportType="full"
reportFormat="xml,html"
snapshotDirectory=""
snapshotFileName="AlarmClock_Snapshot"
proxyHost=""
proxyPort=""
proxyUsername=""
proxyPassword=""
logLevel="warn">
<failSet failOnEmptyWorkspace="false">
<include issueType="any" severity="error" resolution="none"/>
<exclude issueType="ScriptCompilationError" resolution="none"/>
<include issueType="any" severity="warning"/>
<include issueType="ArchitectureViolation"/>
<exclude issueType="Supertype uses subtype" resolution="none"/>
<exclude issueType="ThresholdViolation"/>
</failSet>
</sonargraphBuild>
args
- Path to the configuration file is expected as the only parameter.public static boolean shouldCreateSnapshot(String snapshotDir, String snapshotFileName)
public static void validateReportFormat(String reportFormat)
public static void validateReportType(String reportType)