use of com.intellij.execution.remote.RemoteConfiguration in project android by JetBrains.
the class AndroidJavaDebugger method attachToClient.
@Override
public void attachToClient(@NotNull Project project, @NotNull Client client) {
String debugPort = getClientDebugPort(client);
String runConfigName = String.format(RUN_CONFIGURATION_NAME_PATTERN, debugPort);
// Try to find existing debug session
if (hasExistingDebugSession(project, debugPort, runConfigName)) {
return;
}
// Create run configuration
RemoteConfigurationType remoteConfigurationType = RemoteConfigurationType.getInstance();
ConfigurationFactory factory = remoteConfigurationType.getFactory();
RunnerAndConfigurationSettings runSettings = RunManager.getInstance(project).createRunConfiguration(runConfigName, factory);
RemoteConfiguration configuration = (RemoteConfiguration) runSettings.getConfiguration();
configuration.HOST = "localhost";
configuration.PORT = debugPort;
configuration.USE_SOCKET_TRANSPORT = true;
configuration.SERVER_MODE = false;
ProgramRunnerUtil.executeConfiguration(project, runSettings, DefaultDebugExecutor.getDebugExecutorInstance());
}
use of com.intellij.execution.remote.RemoteConfiguration in project azure-tools-for-java by Microsoft.
the class FunctionRunState method launchDebugger.
@AzureOperation(name = "function.launch_debugger", type = AzureOperation.Type.TASK)
private void launchDebugger(final Project project, int debugPort) {
final Runnable runnable = () -> {
final RunManagerImpl manager = new RunManagerImpl(project);
final ConfigurationFactory configFactory = RemoteConfigurationType.getInstance().getConfigurationFactories()[0];
final RemoteConfiguration remoteConfig = new RemoteConfiguration(project, configFactory);
remoteConfig.PORT = String.valueOf(debugPort);
remoteConfig.HOST = "localhost";
remoteConfig.USE_SOCKET_TRANSPORT = true;
remoteConfig.SERVER_MODE = false;
remoteConfig.setName("azure functions");
final RunnerAndConfigurationSettings configuration = new RunnerAndConfigurationSettingsImpl(manager, remoteConfig, false);
manager.setTemporaryConfiguration(configuration);
ExecutionUtil.runConfiguration(configuration, ExecutorRegistry.getInstance().getExecutorById(ToolWindowId.DEBUG));
};
AzureTaskManager.getInstance().runAndWait(runnable, AzureTask.Modality.ANY);
}
use of com.intellij.execution.remote.RemoteConfiguration in project Intellij-Plugin by getgauge.
the class GaugeRunProcessHandler method launchDebugger.
private static void launchDebugger(final Project project, final GaugeDebugInfo debugInfo) {
Runnable runnable = () -> {
final long startTime = System.currentTimeMillis();
GenericDebuggerRunner basicProgramRunner = new GenericDebuggerRunner();
RunManagerImpl manager = new RunManagerImpl(project);
ConfigurationFactory configFactory = RemoteConfigurationType.getInstance().getConfigurationFactories()[0];
RemoteConfiguration remoteConfig = new RemoteConfiguration(project, configFactory);
remoteConfig.PORT = debugInfo.getPort();
remoteConfig.HOST = debugInfo.getHost();
remoteConfig.USE_SOCKET_TRANSPORT = true;
remoteConfig.SERVER_MODE = false;
RunnerAndConfigurationSettingsImpl configuration = new RunnerAndConfigurationSettingsImpl(manager, remoteConfig, false);
ExecutionEnvironment environment = new ExecutionEnvironment(new DefaultDebugExecutor(), basicProgramRunner, configuration, project);
boolean debuggerConnected = false;
// Trying to connect to gauge java for 25 secs. The sleep is because it may take a few seconds for gauge to launch the java process and the jvm to load after that
while (!debuggerConnected && ((System.currentTimeMillis() - startTime) < 25000)) {
try {
Thread.sleep(5000);
basicProgramRunner.execute(environment);
debuggerConnected = true;
} catch (Exception e) {
System.err.println("Failed to connect debugger. Retrying... : " + e.getMessage());
LOG.debug(e);
}
}
};
ApplicationManager.getApplication().invokeAndWait(runnable, ModalityState.any());
}
use of com.intellij.execution.remote.RemoteConfiguration in project buck by facebook.
the class AndroidDebugger method createRunConfiguration.
private static RunnerAndConfigurationSettings createRunConfiguration(Project project, String debugPort) {
final RemoteConfigurationType remoteConfigurationType = RemoteConfigurationType.getInstance();
final ConfigurationFactory factory = remoteConfigurationType.getFactory();
final RunnerAndConfigurationSettings runSettings = RunManager.getInstance(project).createRunConfiguration(getRunConfigurationName(debugPort), factory);
final RemoteConfiguration configuration = (RemoteConfiguration) runSettings.getConfiguration();
configuration.HOST = "localhost";
configuration.PORT = debugPort;
configuration.USE_SOCKET_TRANSPORT = true;
configuration.SERVER_MODE = false;
return runSettings;
}
Aggregations