use of com.thoughtworks.gauge.core.GaugeExceptionHandler in project Intellij-Plugin by getgauge.
the class GaugeModuleComponent method initializeGaugeProcess.
private static Process initializeGaugeProcess(int apiPort, Module module) {
try {
GaugeSettingsModel settings = getGaugeSettings();
String port = String.valueOf(apiPort);
ProcessBuilder gauge = new ProcessBuilder(settings.getGaugePath(), Constants.DAEMON, port);
GaugeUtil.setGaugeEnvironmentsTo(gauge, settings);
String cp = classpathForModule(module);
LOG.info(String.format("Setting `%s` to `%s`", Constants.GAUGE_CUSTOM_CLASSPATH, cp));
gauge.environment().put(Constants.GAUGE_CUSTOM_CLASSPATH, cp);
File dir = moduleDir(module);
LOG.info(String.format("Using `%s` as api port to connect to gauge API for project %s", port, dir));
gauge.directory(dir);
Process process = gauge.start();
new GaugeExceptionHandler(process, module.getProject()).start();
return process;
} catch (IOException | GaugeNotFoundException e) {
LOG.error("An error occurred while starting gauge api. \n" + e);
}
return null;
}
Aggregations