From 2cfc8729bc843d3709459381ac000edb0091e7a3 Mon Sep 17 00:00:00 2001 From: Luca Vitucci Date: Fri, 6 Oct 2017 16:48:47 +0200 Subject: [PATCH] Added a separate path for surefire junit In order to avoid conflicts with java projects, a separate path has been introduced for surefire junit reports. --- .../java/org/sonar/plugins/swift/SwiftPlugin.java | 12 +++++++++--- .../plugins/swift/surefire/SwiftSurefireSensor.java | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/SwiftPlugin.java b/sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/SwiftPlugin.java index f0ed0b84..ccf460e8 100644 --- a/sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/SwiftPlugin.java +++ b/sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/SwiftPlugin.java @@ -17,8 +17,7 @@ */ package org.sonar.plugins.swift; -import java.util.List; - +import com.google.common.collect.ImmutableList; import org.sonar.api.Properties; import org.sonar.api.Property; import org.sonar.api.SonarPlugin; @@ -37,7 +36,7 @@ import org.sonar.plugins.swift.lang.core.Swift; import org.sonar.plugins.swift.surefire.SwiftSurefireSensor; -import com.google.common.collect.ImmutableList; +import java.util.List; @Properties({ @Property( @@ -67,6 +66,13 @@ name = "Path to lizard report", description = "Relative to projects' root.", global = false, + project = true), + @Property( + key = SwiftSurefireSensor.REPORTS_PATH_KEY, + defaultValue = SwiftSurefireSensor.DEFAULT_REPORTS_PATH, + name = "Path to surefire junit report", + description = "Relative to projects' root.", + global = false, project = true) }) public class SwiftPlugin extends SonarPlugin { diff --git a/sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/surefire/SwiftSurefireSensor.java b/sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/surefire/SwiftSurefireSensor.java index cc23b6f0..a39618e2 100644 --- a/sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/surefire/SwiftSurefireSensor.java +++ b/sonar-swift-plugin/src/main/java/org/sonar/plugins/swift/surefire/SwiftSurefireSensor.java @@ -27,6 +27,7 @@ import org.sonar.api.config.Settings; import org.sonar.api.resources.Project; import org.sonar.api.scan.filesystem.PathResolver; +import org.sonar.plugins.swift.SwiftPlugin; import java.io.File; @@ -34,7 +35,7 @@ public final class SwiftSurefireSensor implements Sensor { private static final Logger LOGGER = LoggerFactory.getLogger(SwiftSurefireSensor.class); - public static final String REPORTS_PATH_KEY = "sonar.junit.reportsPath"; + public static final String REPORTS_PATH_KEY = SwiftPlugin.PROPERTY_PREFIX + "swiftsurefire.junit.reportsPath"; public static final String DEFAULT_REPORTS_PATH = "sonar-reports/";