From 71d676d0dc132b72ddd5c38f64daf473cf252f31 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 14 Mar 2013 15:48:20 +0100 Subject: [PATCH] Fix compatibility with the tasks postponed to sonar 3.6 --- .../main/java/org/sonar/runner/internal/batch/Launcher.java | 5 ++--- .../org/sonar/runner/internal/batch/SonarProjectBuilder.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/Launcher.java b/sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/Launcher.java index 6b9d996..83a34b7 100644 --- a/sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/Launcher.java +++ b/sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/Launcher.java @@ -94,9 +94,8 @@ public class Launcher { } if (StringUtils.isNotBlank(command)) { // This code can only works on Sonar 3.5+ - builder - .setGlobalProperties(toMap(globalConfiguration)) - .setTaskCommand(command); + globalConfiguration.put("sonar.task", command); + builder.setGlobalProperties(toMap(globalConfiguration)); } Batch batch = builder.build(); batch.execute(); diff --git a/sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/SonarProjectBuilder.java b/sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/SonarProjectBuilder.java index 0b3d9af..41ec373 100644 --- a/sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/SonarProjectBuilder.java +++ b/sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/SonarProjectBuilder.java @@ -128,7 +128,7 @@ public final class SonarProjectBuilder { } public ProjectDefinition generateProjectDefinition() { - if (StringUtils.isBlank(command) || "inspect".equals(command)) { + if (StringUtils.isBlank(command) || "scan".equals(command)) { ProjectDefinition rootProject = defineProject(properties, null); rootProjectWorkDir = rootProject.getWorkDir(); defineChildren(rootProject); -- 2.39.5