]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
Fix compatibility with the tasks postponed to sonar 3.6
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 14 Mar 2013 14:48:20 +0000 (15:48 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 14 Mar 2013 14:48:20 +0000 (15:48 +0100)
sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/Launcher.java
sonar-runner-impl/src/main/java/org/sonar/runner/internal/batch/SonarProjectBuilder.java

index 6b9d996e7e422111c2bf6a77e51bd27b78a69fa7..83a34b7a579188c1e096c4049feb5b050ee99ea1 100644 (file)
@@ -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();
index 0b3d9af6a6c94e7ca6c5bab5d427613d905da34f..41ec3737a44f982d2907e2ce7d1ca7edd96246ff 100644 (file)
@@ -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);