Browse Source

SONARPLUGINS-1433 Add the property sonar.verbose

tags/2.5-rc1
Simon Brandhof 12 years ago
parent
commit
c3408e6d05

+ 1
- 1
src/main/java/org/sonar/runner/Main.java View File

@@ -125,7 +125,7 @@ public final class Main {
printUsage();

} else if ("-X".equals(arg) || "--debug".equals(arg)) {
props.setProperty(Runner.DEBUG_MODE, "true");
props.setProperty(Runner.VERBOSE, "true");

} else if ("-D".equals(arg) || "--define".equals(arg)) {
i++;

+ 6
- 1
src/main/java/org/sonar/runner/Runner.java View File

@@ -37,7 +37,12 @@ import java.util.Properties;
* @since 1.1
*/
public final class Runner {
/**
* @deprecated Replaced by sonar.verbose since 1.2
*/
@Deprecated
public static final String DEBUG_MODE = "runner.debug";
private static final String VERBOSE = "sonar.verbose";

private File projectDir;
private File workDir;
@@ -90,7 +95,7 @@ public final class Runner {
}

public boolean isDebug() {
return Boolean.parseBoolean(properties.getProperty(DEBUG_MODE, "false"));
return Boolean.parseBoolean(properties.getProperty(VERBOSE, properties.getProperty(DEBUG_MODE, "false")));
}

public String getRunnerVersion() {

+ 2
- 2
src/test/java/org/sonar/runner/MainTest.java View File

@@ -48,13 +48,13 @@ public class MainTest {
@Test
public void shouldEnableDebugMode() {
Properties props = Main.parseArguments(new String[]{"-X"});
assertThat(props.getProperty(Runner.DEBUG_MODE), is("true"));
assertThat(props.getProperty(Runner.VERBOSE), is("true"));
}

@Test
public void shouldDisableDebugModeByDefault() {
Properties props = Main.parseArguments(new String[]{});
assertThat(props.getProperty(Runner.DEBUG_MODE), nullValue());
assertThat(props.getProperty(Runner.VERBOSE), nullValue());
}

@Test

Loading…
Cancel
Save