diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-04-09 18:25:34 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-04-09 18:25:34 +0200 |
commit | da546c5d9cb6ba740d2839497c5382d0b0861c05 (patch) | |
tree | 4e5b8ed28d47583e569dd68bd277720e1ec3960c /sonar-runner-batch/src/main/java | |
parent | 4580dde63163dc494ab8dc39ddda6d9d67d570cc (diff) | |
download | sonar-scanner-cli-da546c5d9cb6ba740d2839497c5382d0b0861c05.tar.gz sonar-scanner-cli-da546c5d9cb6ba740d2839497c5382d0b0861c05.zip |
Fix compatibility with sonar 3.5 tasks
Diffstat (limited to 'sonar-runner-batch/src/main/java')
-rw-r--r-- | sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java index eee9da7..825c0e1 100644 --- a/sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java +++ b/sonar-runner-batch/src/main/java/org/sonar/runner/batch/IsolatedLauncher.java @@ -32,6 +32,7 @@ import org.sonar.batch.bootstrapper.EnvironmentInformation; import java.io.InputStream; import java.util.List; +import java.util.Map; import java.util.Properties; /** @@ -46,17 +47,21 @@ public class IsolatedLauncher { Batch createBatch(Properties properties, List<Object> extensions) { ProjectReactor projectReactor = null; + initLogging(properties); + EnvironmentInformation env = new EnvironmentInformation(properties.getProperty("sonarRunner.userAgent"), properties.getProperty("sonarRunner.userAgentVersion")); + Batch.Builder builder = Batch.builder() + .setEnvironment(env) + .addComponents(extensions); + String task = properties.getProperty("sonar.task", "scan"); if ("scan".equals(task)) { Properties propsClone = new Properties(); propsClone.putAll(properties); projectReactor = new ProjectReactorBuilder(propsClone).build(); + } else { + // only on sonar 3.5+... in theory + builder.setGlobalProperties((Map)properties); } - initLogging(properties); - EnvironmentInformation env = new EnvironmentInformation(properties.getProperty("sonarRunner.userAgent"), properties.getProperty("sonarRunner.userAgentVersion")); - Batch.Builder builder = Batch.builder() - .setEnvironment(env) - .addComponents(extensions); if (projectReactor != null) { builder.setProjectReactor(projectReactor); |