diff options
author | mickael-caro-sonarsource <mickael.caro@sonarsource.com> | 2020-01-03 15:58:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-03 15:58:43 +0100 |
commit | b526146d2a7af21e6f7feb02e35f1a63a33d09c1 (patch) | |
tree | 1715205ad68d293868141e19e113646b0a2ef244 /src/main/java/org/sonarsource/scanner/cli/Conf.java | |
parent | 460cee11506ca9a7cb919d6cbb66e50029ed9b66 (diff) | |
download | sonar-scanner-cli-b526146d2a7af21e6f7feb02e35f1a63a33d09c1.tar.gz sonar-scanner-cli-b526146d2a7af21e6f7feb02e35f1a63a33d09c1.zip |
SQSCANNER-57 - Rename scanner SonarScanner (#78)
* SQSCANNER-57 - Rename scanner SonarScanner
Diffstat (limited to 'src/main/java/org/sonarsource/scanner/cli/Conf.java')
-rw-r--r-- | src/main/java/org/sonarsource/scanner/cli/Conf.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/sonarsource/scanner/cli/Conf.java b/src/main/java/org/sonarsource/scanner/cli/Conf.java index b914516..e6a84a8 100644 --- a/src/main/java/org/sonarsource/scanner/cli/Conf.java +++ b/src/main/java/org/sonarsource/scanner/cli/Conf.java @@ -28,6 +28,7 @@ import java.nio.file.Paths; import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Properties; import javax.annotation.Nullable; @@ -42,6 +43,7 @@ class Conf { private static final String PROPERTY_PROJECT_BASEDIR = "sonar.projectBaseDir"; private static final String PROPERTY_PROJECT_CONFIG_FILE = "sonar.projectConfigFile"; private static final String SONAR_PROJECT_PROPERTIES_FILENAME = "sonar-project.properties"; + private static final String PROPERTY_SONAR_HOST_URL = "sonar.host.url"; private final Cli cli; private final Logs logger; @@ -68,6 +70,15 @@ class Conf { return result; } + boolean isSonarCloud(@Nullable Properties testProperties) { + String hostUrl = testProperties != null ? testProperties.getProperty(PROPERTY_SONAR_HOST_URL) : properties().getProperty(PROPERTY_SONAR_HOST_URL); + if (hostUrl != null) { + return hostUrl.toLowerCase(Locale.getDefault()).contains("sonarcloud"); + } + + return false; + } + private Properties resolve(Properties props) { PropertyResolver resolver = new PropertyResolver(props, env); return resolver.resolve(); |