@Nullable @Override public RunContentDescriptor execute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { if (state instanceof GoApplicationRunningState) { FileDocumentManager.getInstance().saveAllDocuments(); ((GoApplicationRunningState)state).setHistoryProcessHandler(myHistoryProcessListener); ((GoApplicationRunningState)state).setOutputFilePath(myOutputFilePath); ((GoApplicationRunningState)state).setCompilationFailed(myCompilationFailed); ExecutionResult executionResult = state.execute(env.getExecutor(), GoBuildingRunner.this); return executionResult != null ? new RunContentBuilder(executionResult, env).showRunContent(env.getContentToReuse()) : null; } return null; } }
public boolean isDebug() { return DefaultDebugExecutor.EXECUTOR_ID.equals(getEnvironment().getExecutor().getId()); }
@Nullable @Override protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException { assert state instanceof GoTestRunningState; GoTestRunningState runningState = (GoTestRunningState)state; GoTestRunConfiguration runConfiguration = ObjectUtils.tryCast(environment.getRunProfile(), GoTestRunConfiguration.class); if (runConfiguration == null) { return null; } FileDocumentManager.getInstance().saveAllDocuments(); CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(runConfiguration); runningState.setCoverageFilePath(coverageEnabledConfiguration.getCoverageFilePath()); ExecutionResult executionResult = state.execute(environment.getExecutor(), this); if (executionResult == null) { return null; } CoverageHelper.attachToProcess(runConfiguration, executionResult.getProcessHandler(), environment.getRunnerSettings()); return new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse()); } }
ExecutionResult executionResult = state.execute(env.getExecutor(), GoBuildingRunner.this); if (executionResult == null) { throw new ExecutionException("Cannot run debugger"); return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() { @NotNull @Override
((BallerinaApplicationRunningState) state).setDebugPort(port); return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() { ((BallerinaTestRunningState) state).setDebugPort(port); return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() { } else if (state instanceof BallerinaRemoteRunningState) { FileDocumentManager.getInstance().saveAllDocuments(); return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() {
public PerlRemoteDebuggingRunProfileState(ExecutionEnvironment environment) { super(environment); PerlRemoteDebuggingConfiguration debuggingConfiguration = (PerlRemoteDebuggingConfiguration)environment.getRunProfile(); Project project = environment.getProject(); String projectPath = project.getBaseDir().getCanonicalPath(); myLocalProjectPath = new File(projectPath == null ? "" : projectPath); myRemoteProjectPath = new File(debuggingConfiguration.getRemoteProjectRoot()); }
@Nullable private String getRemoteAddress(@NotNull ExecutionEnvironment env) { RunnerAndConfigurationSettings runnerAndConfigurationSettings = env.getRunnerAndConfigurationSettings(); if (runnerAndConfigurationSettings == null) { return null; } RunConfiguration configurationSettings = runnerAndConfigurationSettings.getConfiguration(); if (configurationSettings instanceof BallerinaRemoteConfiguration) { BallerinaRemoteConfiguration applicationConfiguration = (BallerinaRemoteConfiguration) configurationSettings; String remoteDebugHost = applicationConfiguration.getRemoteDebugHost(); if (remoteDebugHost.isEmpty()) { return null; } String remoteDebugPort = applicationConfiguration.getRemoteDebugPort(); if (remoteDebugPort.isEmpty()) { return null; } return remoteDebugHost + ":" + remoteDebugPort; } return null; }
static ExecutionEnvironment getExecutionEnvironment(Project project, RunnerAndConfigurationSettings configuration, ProgramRunner runner, ExecutionTarget target, Executor executor) { ExecutionEnvironmentBuilder builder = new ExecutionEnvironmentBuilder(project, executor); if (configuration != null) { // builder.setRunnerAndSettings(runner, configuration); builder.runnerAndSettings(runner, configuration); } else { // builder.setRunnerId(runner.getRunnerId()); builder.runner(runner); } // builder.setTarget(target).setContentToReuse(null).setDataContext(null); builder.target(target) .contentToReuse(null) .dataContext(null); return builder.build(); }
@Override protected void execute(@NotNull ExecutionEnvironment environment, Callback callback, @NotNull RunProfileState state) throws ExecutionException { super.execute(environment, descriptor -> { ProcessHandler processHandler = descriptor.getProcessHandler(); if (processHandler != null) { CoverageHelper.attachToProcess((PerlRunConfiguration)environment.getRunProfile(), processHandler, environment.getRunnerSettings()); } if (callback != null) { callback.processStarted(descriptor); } }, new PerlCoverageProfileState(environment)); } }
public PerlDebugOptions getDebugOptions() { return (PerlDebugOptions)getEnvironment().getRunProfile(); } }
public interface Listener { public void onCompileComplete(boolean aborted, int errors, int warnings, final CompileContext compileContext); /** * Implied by having errors or aborted=true in onCompileComplete, * but if you want a more discrete signal then here it is */ void onCompileFailed(); /** * Implied by having no errors and aborted=false in onCompileComplete, * but if you want a more discrete signal then here it is */ void onCompileSucceeded(); /** * In some situations, we may not be able to compile before running. */ void onCompileSkipped(); /** * Called when we've successfully compiled and started running. * The ProcessHandler is guaranteed to be non-null here */ void onProcessStarted(RunContentDescriptor descriptor, final ProcessHandler handler); /** * Called if something went wrong trying to run the * compiled program */ void onRunException(ExecutionException e); }
@Override protected RunContentDescriptor doExecute( @NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { ensureSingleDebugSession(env.getProject()); CloudDebugProcessState cloudState = null; if (state instanceof CloudDebugProcessState) { cloudState = (CloudDebugProcessState) state; } FileDocumentManager.getInstance().saveAllDocuments(); state.execute(env.getExecutor(), this); return createContentDescriptor(cloudState, env); }
@Nullable @Override protected MyRunProfile getRunProfile(@NotNull final ExecutionEnvironment environment) { final Project project = environment.getProject(); return project != null? getRunProfile(project) : null; }
/** * Indicates whether the debugging is invoked or not. * * @return {@code true} if debugging is running, {@code false} otherwise. */ private boolean isDebug() { return DefaultDebugExecutor.EXECUTOR_ID.equals(getEnvironment().getExecutor().getId()); } }
File outputFile; String outputDirectoryPath = state.getConfiguration().getOutputFilePath(); RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings(); String configurationName = settings != null ? settings.getName() : "application"; if (StringUtil.isEmpty(outputDirectoryPath)) {
protected String getPrgName() { return getEnvironment().getProject().getName() + ".prg"; }
/** * Indicates whether the debugging is invoked or not. * * @return {@code true} if debugging is running, {@code false} otherwise. */ private boolean isDebug() { return DefaultDebugExecutor.EXECUTOR_ID.equals(getEnvironment().getExecutor().getId()); }
protected AbstractMonkeyModuleBasedConfiguration getConfiguration() { if (getEnvironment().getRunnerAndConfigurationSettings() == null) { throw new RuntimeException("runnerAndConfigurationSettings is null"); } final RunConfiguration configuration = getEnvironment().getRunnerAndConfigurationSettings().getConfiguration(); if (configuration == null || !(configuration instanceof AbstractMonkeyModuleBasedConfiguration)) { throw new RuntimeException("runnerAndConfigurationSettings.getConfiguration() is null or wrong type"); } return (AbstractMonkeyModuleBasedConfiguration) configuration; }
private ExecutionResult getExecutionResults(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { // Start debugger. ExecutionResult executionResult = state.execute(env.getExecutor(), new BallerinaDebugger()); if (executionResult == null) { throw new ExecutionException("Cannot run debugger"); } return executionResult; }
@NotNull @Override public XDebugProcess start(@NotNull XDebugSession session) throws ExecutionException { return new PerlDebugProcess(session, (PerlDebugProfileStateBase)state, state.execute(env.getExecutor(), PerlDebuggerProgramRunner.this)); } });