Search in sources :

Example 1 with FlutterCommandStartResult

use of io.flutter.sdk.FlutterCommandStartResult in project flutter-intellij by flutter.

the class TestLaunchState method startProcess.

@NotNull
@Override
protected ProcessHandler startProcess() throws ExecutionException {
    final RunMode mode = RunMode.fromEnv(getEnvironment());
    final FlutterCommandStartResult result = fields.run(getEnvironment().getProject(), mode);
    switch(result.status) {
        case OK:
            assert result.processHandler != null;
            processHandler = result.processHandler;
            return result.processHandler;
        case EXCEPTION:
            assert result.exception != null;
            throw new ExecutionException(FlutterBundle.message("flutter.command.exception.message" + result.exception.getMessage()));
        default:
            throw new ExecutionException("Unexpected state");
    }
}
Also used : RunMode(io.flutter.run.common.RunMode) FlutterCommandStartResult(io.flutter.sdk.FlutterCommandStartResult) ExecutionException(com.intellij.execution.ExecutionException) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ExecutionException (com.intellij.execution.ExecutionException)1 RunMode (io.flutter.run.common.RunMode)1 FlutterCommandStartResult (io.flutter.sdk.FlutterCommandStartResult)1 NotNull (org.jetbrains.annotations.NotNull)1