]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
Fix compatibility with sonar 3.5
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 15 Apr 2013 12:39:11 +0000 (14:39 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 15 Apr 2013 12:39:11 +0000 (14:39 +0200)
sonar-runner-api/src/main/java/org/sonar/runner/api/Runner.java
sonar-runner-api/src/main/java/org/sonar/runner/api/Utils.java
sonar-runner-api/src/test/java/org/sonar/runner/api/UtilsTest.java

index 0fbd4ba39998126a527d98b345313da70827cf69..afa5c3770ce18839f39d628087ceb7e4de030c62 100644 (file)
@@ -93,7 +93,7 @@ public abstract class Runner<T extends Runner> {
 
   private void initDefaultValues() {
     setDefaultValue(RunnerProperties.HOST_URL, "http://localhost:9000");
-    setDefaultValue(RunnerProperties.TASK, "scan");
+    //setDefaultValue(RunnerProperties.TASK, "scan");
     setDefaultValue(InternalProperties.RUNNER_APP, "SonarRunner");
     setDefaultValue(InternalProperties.RUNNER_APP_VERSION, RunnerVersion.version());
   }
index a9c18ebb0ddb50f3733d5b07d837800943710ebb..b87442d9cefbacc58987b5b4a916d99f4f11ae92 100644 (file)
@@ -45,6 +45,7 @@ class Utils {
   }
 
   static boolean taskRequiresProject(Properties props) {
-    return ScanProperties.SCAN_TASK.equals(props.get(RunnerProperties.TASK));
+    Object task = props.get(RunnerProperties.TASK);
+    return task == null || ScanProperties.SCAN_TASK.equals(task);
   }
 }
index 8bb4ec229eb487a2699e440c1dd7b2030aac3d16..6ab54878eb8c55f8f228212c2948df3625019e85 100644 (file)
@@ -36,6 +36,8 @@ public class UtilsTest {
   @Test
   public void task_should_require_project() {
     Properties props = new Properties();
+    assertThat(Utils.taskRequiresProject(props)).isTrue();
+
     props.setProperty("sonar.task", "scan");
     assertThat(Utils.taskRequiresProject(props)).isTrue();
   }
@@ -43,7 +45,6 @@ public class UtilsTest {
   @Test
   public void task_should_not_require_project() {
     Properties props = new Properties();
-    assertThat(Utils.taskRequiresProject(props)).isFalse();
     props.setProperty("sonar.task", "views");
     assertThat(Utils.taskRequiresProject(props)).isFalse();
   }