Exemplo n.º 1
0
 protected Executor createExecutor(LaunchParameters launchParameters, String cmd)
     throws IOException {
   Map<String, String> env = launchParameters.getEnvironment();
   return new Executor(config.getLogger(), cmd)
       .args(launchParameters.getArguments())
       .wd(launchParameters.getWorkingDirectory())
       .inheritEnv(env == null)
       .env(env == null ? Collections.<String, String>emptyMap() : env);
 }
Exemplo n.º 2
0
  public Process launch(LaunchParameters launchParameters) throws IOException {
    if (config.isSkipLinking()) {
      throw new IllegalStateException("Cannot skip linking if target should be run");
    }

    // Add -rvm:log=warn to command line arguments if no logging level has been set explicitly
    boolean add = true;
    for (String arg : launchParameters.getArguments()) {
      if (arg.startsWith("-rvm:log=")) {
        add = false;
        break;
      }
    }
    if (add) {
      List<String> args = new ArrayList<String>(launchParameters.getArguments());
      args.add(0, "-rvm:log=warn");
      launchParameters.setArguments(args);
    }

    return doLaunch(launchParameters);
  }