aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-protocol/src/main/java
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2019-03-05 09:59:43 +0100
committerSonarTech <sonartech@sonarsource.com>2019-03-08 20:20:55 +0100
commitf6b2a269c44043f1c230b646dbb8662aed3fa5a4 (patch)
tree748f02bcbe36adf577afadb68de6a40ebe6dc83e /sonar-scanner-protocol/src/main/java
parent8fb0a6166734d74674d93863cc4556388a0154e9 (diff)
downloadsonarqube-f6b2a269c44043f1c230b646dbb8662aed3fa5a4.tar.gz
sonarqube-f6b2a269c44043f1c230b646dbb8662aed3fa5a4.zip
SONAR-11795 Drop persistit and move coverage measures computation to CE side
Diffstat (limited to 'sonar-scanner-protocol/src/main/java')
-rw-r--r--sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportWriter.java9
1 files changed, 6 insertions, 3 deletions
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 e20e37ff852..42292da429b 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
@@ -112,10 +112,13 @@ public class ScannerReportWriter {
}
}
- public File writeComponentMeasures(int componentRef, Iterable<ScannerReport.Measure> measures) {
+ public void appendComponentMeasure(int componentRef, ScannerReport.Measure measure) {
File file = fileStructure.fileFor(FileStructure.Domain.MEASURES, componentRef);
- Protobuf.writeStream(measures, file, false);
- return file;
+ try (OutputStream out = new BufferedOutputStream(new FileOutputStream(file, true))) {
+ measure.writeDelimitedTo(out);
+ } catch (Exception e) {
+ throw ContextException.of("Unable to write measure", e).addContext("file", file);
+ }
}
public File writeComponentChangesets(ScannerReport.Changesets changesets) {