import org.sonar.runner.impl.InternalProperties;
import javax.annotation.Nullable;
+
import java.util.Properties;
/**
private void initDefaultValues() {
setDefaultValue(RunnerProperties.HOST_URL, "http://localhost:9000");
- //setDefaultValue(RunnerProperties.TASK, "scan");
setDefaultValue(InternalProperties.RUNNER_APP, "SonarRunner");
setDefaultValue(InternalProperties.RUNNER_APP_VERSION, RunnerVersion.version());
}
doExecute(jarDownloader, props, extensions);
}
+ private static String[][] getMaskRules(final Properties props) {
+ String maskRulesProp = props.getProperty(InternalProperties.RUNNER_MASK_RULES, null);
+ String[] maskRulesConcat = maskRulesProp != null ? maskRulesProp.split(",") : new String[0];
+ String[][] maskRules = new String[maskRulesConcat.length][2];
+ for (int i = 0; i < maskRulesConcat.length; i++) {
+ String[] splitted = maskRulesConcat[i].split("\\|");
+ maskRules[i][0] = splitted[0];
+ maskRules[i][1] = splitted.length > 1 ? splitted[1] : "";
+ }
+ return maskRules;
+ }
+
/**
* @return the {@link org.sonar.runner.batch.IsolatedLauncher} instance for unit tests
*/
Object launcher = AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
List<File> jarFiles = jarDownloader.download();
- String maskRulesProp = props.getProperty(InternalProperties.RUNNER_MASK_RULES, null);
- String[] maskRulesConcat = maskRulesProp != null ? maskRulesProp.split(",") : new String[0];
- String[][] maskRules = new String[maskRulesConcat.length][2];
- for (int i = 0; i < maskRulesConcat.length; i++) {
- String[] splitted = maskRulesConcat[i].split("\\|");
- maskRules[i][0] = splitted[0];
- maskRules[i][1] = splitted.length > 1 ? splitted[1] : "";
- }
+ String[][] maskRules = getMaskRules(props);
IsolatedClassloader classloader = new IsolatedClassloader(getClass().getClassLoader(), maskRules);
classloader.addFiles(jarFiles);
Object launcher = delegateExecution(classloader, props, extensions);