use of com.intellij.javascript.nodejs.interpreter.NodeJsInterpreter in project intellij-plugins by JetBrains.
the class KarmaRunProfileState method getServerOrStart.
@Nullable
public KarmaServer getServerOrStart(@NotNull final Executor executor) throws ExecutionException {
NodeJsInterpreter interpreter = myRunSettings.getInterpreterRef().resolve(myProject);
NodeJsLocalInterpreter localInterpreter = NodeJsLocalInterpreter.castAndValidate(interpreter);
KarmaServerSettings serverSettings = new KarmaServerSettings.Builder().setNodeInterpreter(localInterpreter).setKarmaPackage(myKarmaPackage).setRunSettings(myRunSettings).setWithCoverage(myExecutionType == KarmaExecutionType.COVERAGE).setDebug(myExecutionType == KarmaExecutionType.DEBUG).build();
KarmaServerRegistry registry = KarmaServerRegistry.getInstance(myProject);
KarmaServer server = registry.getServer(serverSettings);
if (server != null && server.getRestarter().isRestartRequired()) {
server.shutdownAsync();
server = null;
}
if (server == null) {
registry.startServer(serverSettings, new CatchingConsumer<KarmaServer, Exception>() {
@Override
public void consume(KarmaServer server) {
RunnerAndConfigurationSettings configuration = myEnvironment.getRunnerAndConfigurationSettings();
if (configuration != null) {
ProgramRunnerUtil.executeConfiguration(myProject, configuration, executor);
}
}
@Override
public void consume(final Exception e) {
LOG.error(e);
showServerStartupError(e);
}
});
}
return server;
}
use of com.intellij.javascript.nodejs.interpreter.NodeJsInterpreter in project intellij-plugins by JetBrains.
the class KarmaRunConfiguration method check.
private void check(@NotNull NodePackage karmaPackage) throws RuntimeConfigurationException {
NodeJsInterpreter interpreter = myRunSettings.getInterpreterRef().resolve(getProject());
NodeJsLocalInterpreter.checkForRunConfiguration(interpreter);
karmaPackage.validateForRunConfiguration(KarmaUtil.NODE_PACKAGE_NAME);
validatePath("configuration file", myRunSettings.getConfigPath());
if (myRunSettings.getScopeKind() == KarmaScopeKind.TEST_FILE) {
validatePath("test file", myRunSettings.getTestFileSystemDependentPath());
}
}
Aggregations