aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/main/java/org/sonar/scanner
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-27 22:57:19 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-27 22:57:19 +0200
commitb710ae53feba2a4d8d2c181a26d5d1163e407d1b (patch)
treeb6c485dd46d35115a0100dbe25d594a4dca8733d /sonar-scanner-engine/src/main/java/org/sonar/scanner
parente4ba85fe304aaad519e574b8f4e172b733389752 (diff)
parent85bfbe28689b4276a04eeeed91b205ab76e81d06 (diff)
downloadsonarqube-b710ae53feba2a4d8d2c181a26d5d1163e407d1b.tar.gz
sonarqube-b710ae53feba2a4d8d2c181a26d5d1163e407d1b.zip
Fix merge of branch-6.0
Diffstat (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java11
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java10
2 files changed, 9 insertions, 12 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java
index 605a067c66f..cb98c42d047 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/GlobalContainer.java
@@ -21,13 +21,14 @@ package org.sonar.scanner.bootstrap;
import java.util.List;
import java.util.Map;
-
import org.sonar.api.Plugin;
-import org.sonar.api.SonarProduct;
import org.sonar.api.SonarQubeSide;
-import org.sonar.api.internal.SonarRuntimeFactory;
+import org.sonar.api.SonarQubeVersion;
+import org.sonar.api.internal.ApiVersion;
+import org.sonar.api.internal.SonarRuntimeImpl;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.UriReader;
+import org.sonar.api.utils.Version;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.core.platform.ComponentContainer;
@@ -69,6 +70,7 @@ public class GlobalContainer extends ComponentContainer {
}
private void addBootstrapComponents() {
+ Version apiVersion = ApiVersion.load(System2.INSTANCE);
add(
// plugins
BatchPluginRepository.class,
@@ -78,7 +80,8 @@ public class GlobalContainer extends ComponentContainer {
BatchPluginPredicate.class,
ExtensionInstaller.class,
- SonarRuntimeFactory.create(System2.INSTANCE, SonarProduct.SONARQUBE, SonarQubeSide.SCANNER),
+ new SonarQubeVersion(apiVersion),
+ SonarRuntimeImpl.forSonarQube(apiVersion, SonarQubeSide.SCANNER),
CachesManager.class,
GlobalSettings.class,
new BatchWsClientProvider(),
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java
index d3cb867c509..f19633527af 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java
@@ -20,7 +20,6 @@
package org.sonar.scanner.sensor;
import java.io.Serializable;
-import org.sonar.api.SonarProduct;
import org.sonar.api.SonarRuntime;
import org.sonar.api.batch.AnalysisMode;
import org.sonar.api.batch.fs.FileSystem;
@@ -100,13 +99,8 @@ public class DefaultSensorContext implements SensorContext {
}
@Override
- public Version getRuntimeApiVersion() {
- return sonarRuntime.getApiVersion();
- }
-
- @Override
- public SonarProduct getRuntimeProduct() {
- return sonarRuntime.getProduct();
+ public SonarRuntime runtime() {
+ return sonarRuntime;
}
@Override