Skip to content

Commit 439be7a

Browse files
committed
Fix send coverage to SonarQube with mixed objc swift project
1 parent ac6fd1b commit 439be7a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/org/sonar/plugins/swift/coverage/SwiftCoberturaSensor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public final class SwiftCoberturaSensor implements Sensor {
3838
private static final Logger LOGGER = LoggerFactory.getLogger(SwiftCoberturaSensor.class);
3939

4040
public static final String REPORT_PATTERN_KEY = SwiftPlugin.PROPERTY_PREFIX + ".coverage.reportPattern";
41-
public static final String DEFAULT_REPORT_PATTERN = "sonar-reports/coverage*.xml";
41+
public static final String DEFAULT_REPORT_PATTERN = "sonar-reports/coverage-swift*.xml";
4242

4343
private final ReportFilesFinder reportFilesFinder;
4444

src/main/shell/run-sonar-swift.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ if [ "$unittests" = "on" ]; then
256256

257257
# Put default xml files with no tests and no coverage...
258258
echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?><testsuites name='AllTestUnits'></testsuites>" > sonar-reports/TEST-report.xml
259-
echo "<?xml version='1.0' ?><!DOCTYPE coverage SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-03.dtd'><coverage><sources></sources><packages></packages></coverage>" > sonar-reports/coverage.xml
259+
echo "<?xml version='1.0' ?><!DOCTYPE coverage SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-03.dtd'><coverage><sources></sources><packages></packages></coverage>" > sonar-reports/coverage-swift.xml
260260

261261
echo -n 'Running tests'
262262
buildCmd=(xcodebuild clean build test)
@@ -308,7 +308,7 @@ if [ "$unittests" = "on" ]; then
308308
echo "${slatherCmd[@]}"
309309

310310
runCommand /dev/stdout "${slatherCmd[@]}"
311-
mv sonar-reports/cobertura.xml sonar-reports/coverage.xml
311+
mv sonar-reports/cobertura.xml sonar-reports/coverage-swift.xml
312312
fi
313313

314314
# SwiftLint

0 commit comments

Comments
 (0)