Search in sources :

Example 1 with BallerinaExecutor

use of org.ballerinalang.plugins.idea.util.BallerinaExecutor in project ballerina by ballerina-lang.

the class BallerinaRunningState method startProcess.

@NotNull
@Override
protected ProcessHandler startProcess() throws ExecutionException {
    BallerinaExecutor executor = patchExecutor(createCommonExecutor());
    // We only need to set parameters.
    GeneralCommandLine commandLine = executor.withParameterString(myConfiguration.getParams()).createCommandLine();
    KillableColoredProcessHandler handler = new KillableColoredProcessHandler(commandLine, true);
    ProcessTerminatedListener.attach(handler);
    return handler;
}
Also used : GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) BallerinaExecutor(org.ballerinalang.plugins.idea.util.BallerinaExecutor) KillableColoredProcessHandler(com.intellij.execution.process.KillableColoredProcessHandler) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with BallerinaExecutor

use of org.ballerinalang.plugins.idea.util.BallerinaExecutor in project ballerina by ballerina-lang.

the class BallerinaTestRunningState method patchExecutor.

@Override
protected BallerinaExecutor patchExecutor(@NotNull BallerinaExecutor executor) throws ExecutionException {
    String parameters = myConfiguration.getPackage();
    BallerinaExecutor ballerinaExecutor = executor.withParameters("test").withBallerinaPath(BallerinaSdkService.getInstance(getConfiguration().getProject()).getSdkHomePath(null)).withParameterString(myConfiguration.getBallerinaToolParams()).withParameters(parameters);
    // If debugging mode is running, we need to add the debugging flag.
    if (isDebug()) {
        ballerinaExecutor.withParameters("--debug", String.valueOf(myDebugPort));
    }
    return ballerinaExecutor;
}
Also used : BallerinaExecutor(org.ballerinalang.plugins.idea.util.BallerinaExecutor)

Example 3 with BallerinaExecutor

use of org.ballerinalang.plugins.idea.util.BallerinaExecutor in project ballerina by ballerina-lang.

the class BallerinaApplicationRunningState method patchExecutor.

@Override
protected BallerinaExecutor patchExecutor(@NotNull BallerinaExecutor executor) throws ExecutionException {
    RunConfigurationKind kind = getConfiguration().getRunKind();
    String parameters = myConfiguration.getPackage();
    if (parameters.isEmpty()) {
        parameters = myConfiguration.getFilePath();
    }
    BallerinaExecutor ballerinaExecutor = executor.withParameters("run").withBallerinaPath(BallerinaSdkService.getInstance(getConfiguration().getProject()).getSdkHomePath(null)).withParameterString(myConfiguration.getBallerinaToolParams()).withParameters(parameters);
    if (kind == RunConfigurationKind.SERVICE) {
        ballerinaExecutor.withParameters("-s");
    }
    // If debugging mode is running, we need to add the debugging flag.
    if (isDebug()) {
        ballerinaExecutor.withParameters("--debug", String.valueOf(myDebugPort));
    }
    return ballerinaExecutor;
}
Also used : BallerinaExecutor(org.ballerinalang.plugins.idea.util.BallerinaExecutor) RunConfigurationKind(org.ballerinalang.plugins.idea.runconfig.RunConfigurationKind)

Aggregations

BallerinaExecutor (org.ballerinalang.plugins.idea.util.BallerinaExecutor)3 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)1 KillableColoredProcessHandler (com.intellij.execution.process.KillableColoredProcessHandler)1 RunConfigurationKind (org.ballerinalang.plugins.idea.runconfig.RunConfigurationKind)1 NotNull (org.jetbrains.annotations.NotNull)1