use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class StyleCopParser method findSourceFiles.
/**
* Go through all violations and see if the source files can be found.
* @param model model containing all violations
* @param workspace the workspace
* @param sourcePaths the optional source paths
*/
private void findSourceFiles(FullBuildModel model, String workspace, String[] sourcePaths) {
AbsoluteFileFinder finder = new AbsoluteFileFinder();
finder.addSourcePath(workspace);
if (sourcePaths != null) {
finder.addSourcePaths(sourcePaths);
}
Map<String, FullFileModel> fileModelMap = model.getFileModelMap();
for (Map.Entry<String, FullFileModel> entry : fileModelMap.entrySet()) {
FullFileModel fileModel = entry.getValue();
File sourceFile = finder.getFileForName(fileModel.getDisplayName());
if (sourceFile != null) {
fileModel.setSourceFile(sourceFile);
fileModel.setLastModified(sourceFile.lastModified());
}
}
}
use of hudson.plugins.violations.model.FullFileModel in project violations-plugin by jenkinsci.
the class XmllintParser method parseLine.
/**
* Parses a Xmllint line and adding a violation if regex
*
* @param model
* build model to add violations to
* @param line
* the line in the file.
* @param projectPath
* the path to use to resolve the file.
*/
public void parseLine(FullBuildModel model, String line, File projectPath) {
XmllintViolation xmllintViolation = getXmllintViolation(line);
if (xmllintViolation != null) {
Violation violation = new Violation();
violation.setType("xmllint");
violation.setLine(xmllintViolation.getLineStr());
violation.setMessage(xmllintViolation.getMessage());
violation.setSource(xmllintViolation.getViolationId());
setServerityLevel(violation, xmllintViolation.getViolationId());
FullFileModel fileModel = getFileModel(model, xmllintViolation.getFileName(), absoluteFileFinder.getFileForName(xmllintViolation.getFileName()));
fileModel.addViolation(violation);
}
}
Aggregations