diff options
author | Janos Gyerik <janos.gyerik@sonarsource.com> | 2018-09-11 16:28:09 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2018-10-10 09:23:04 +0200 |
commit | 8b06219ef58e8eb5382ff1310747632e2c2d366e (patch) | |
tree | b17d57a4dc2a1a2bcc96bfff92f25b8423901016 /sonar-scanner-protocol | |
parent | 9c38ed460e4b4cb01e7ed977f52424cdfd4a747e (diff) | |
download | sonarqube-8b06219ef58e8eb5382ff1310747632e2c2d366e.tar.gz sonarqube-8b06219ef58e8eb5382ff1310747632e2c2d366e.zip |
SONAR-11241 Write analysis warnings to scanner report
Diffstat (limited to 'sonar-scanner-protocol')
3 files changed, 15 insertions, 0 deletions
diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java index 5b7e6ddb851..a86186208dc 100644 --- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java +++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/FileStructure.java @@ -89,6 +89,10 @@ public class FileStructure { return new File(dir, "context-props.pb"); } + public File analysisWarnings() { + return new File(dir, "analysis-warnings.pb"); + } + public File root() { return dir; } diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java index 30e86e986f5..fd9865816d4 100644 --- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java +++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java @@ -172,6 +172,12 @@ public class ScannerReportWriter { return file; } + public File writeAnalysisWarnings(Iterable<ScannerReport.AnalysisWarning> analysisWarnings) { + File file = fileStructure.analysisWarnings(); + Protobuf.writeStream(analysisWarnings, file, false); + return file; + } + public File getSourceFile(int componentRef) { return fileStructure.fileFor(FileStructure.Domain.SOURCE, componentRef); } diff --git a/sonar-scanner-protocol/src/main/protobuf/scanner_report.proto b/sonar-scanner-protocol/src/main/protobuf/scanner_report.proto index 40af083e138..98478dec6f4 100644 --- a/sonar-scanner-protocol/src/main/protobuf/scanner_report.proto +++ b/sonar-scanner-protocol/src/main/protobuf/scanner_report.proto @@ -345,3 +345,8 @@ message CoverageDetail { repeated int32 covered_line = 2 [packed = true]; } } + +message AnalysisWarning { + string text = 1; + int64 timestamp = 2; +} |