use of com.intellij.remoteServer.impl.configuration.deployment.DeployToServerRunConfiguration in project google-cloud-intellij by GoogleCloudPlatform.
the class BuildDeploymentSourceType method setConfiguration.
/**
* Manually set the deployment configuration so that its available immediately in the deployment
* configuration dialog even if the user does not trigger any UI actions. This prevents downstream
* npe's in {@link DeployToServerRunConfiguration#checkConfiguration()}.
*/
@SuppressWarnings("unchecked")
private void setConfiguration(@NotNull RunConfiguration configuration) {
if (configuration instanceof DeployToServerRunConfiguration) {
DeployToServerRunConfiguration deployRunConfiguration = ((DeployToServerRunConfiguration) configuration);
deployRunConfiguration.setDeploymentConfiguration(new AppEngineDeploymentConfiguration());
}
}
use of com.intellij.remoteServer.impl.configuration.deployment.DeployToServerRunConfiguration in project intellij-community by JetBrains.
the class CloudRunConfigurationUtil method createRunConfiguration.
public static <SC extends ServerConfiguration, DC extends DeploymentConfiguration> DeployToServerRunConfiguration<SC, DC> createRunConfiguration(RemoteServer<SC> account, Module module, DeploymentSource deploymentSource, DC deploymentConfiguration) {
Project project = module.getProject();
String accountName = account.getName();
String name = generateRunConfigurationName(accountName, module.getName());
final RunManagerEx runManager = RunManagerEx.getInstanceEx(project);
ConfigurationFactory configurationFactory = getRunConfigurationType(account.getType()).getConfigurationFactories()[0];
final RunnerAndConfigurationSettings runSettings = runManager.createRunConfiguration(name, configurationFactory);
final DeployToServerRunConfiguration<SC, DC> result = (DeployToServerRunConfiguration<SC, DC>) runSettings.getConfiguration();
result.setServerName(accountName);
result.setDeploymentSource(deploymentSource);
result.setDeploymentConfiguration(deploymentConfiguration);
((ConfigurationFactoryEx) configurationFactory).onNewConfigurationCreated(runSettings.getConfiguration());
runManager.addConfiguration(runSettings, false);
runManager.setSelectedConfiguration(runSettings);
return result;
}
use of com.intellij.remoteServer.impl.configuration.deployment.DeployToServerRunConfiguration in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineFlexibleSupportProvider method setupDeploymentRunConfiguration.
private static void setupDeploymentRunConfiguration(Module module) {
RunManager runManager = RunManager.getInstance(module.getProject());
if (!hasFlexibleDeploymentConfiguration(runManager.getAllConfigurationsList())) {
AppEngineCloudType serverType = ServerType.EP_NAME.findExtension(AppEngineCloudType.class);
DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), configurationType.getFactory());
// Sets the GAE Flex server, if any exists, in the run config.
DeployToServerRunConfiguration<?, AppEngineDeploymentConfiguration> runConfiguration = (DeployToServerRunConfiguration<?, AppEngineDeploymentConfiguration>) settings.getConfiguration();
RemoteServer<AppEngineServerConfiguration> server = ContainerUtil.getFirstItem(RemoteServersManager.getInstance().getServers(serverType));
if (server != null) {
runConfiguration.setServerName(server.getName());
}
runManager.addConfiguration(settings, false);
}
}
use of com.intellij.remoteServer.impl.configuration.deployment.DeployToServerRunConfiguration in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineStandardWebIntegration method setupDeployRunConfiguration.
private void setupDeployRunConfiguration(@NotNull Module module) {
RunManager runManager = RunManager.getInstance(module.getProject());
boolean hasExistingDeployConfiguration = runManager.getAllConfigurationsList().stream().filter(config -> config instanceof DeployToServerRunConfiguration).map(config -> ((DeployToServerRunConfiguration) config).getServerType()).anyMatch(serverType -> serverType instanceof AppEngineCloudType);
if (!hasExistingDeployConfiguration) {
AppEngineCloudType serverType = ServerType.EP_NAME.findExtension(AppEngineCloudType.class);
RemoteServer<AppEngineServerConfiguration> server = ContainerUtil.getFirstItem(RemoteServersManager.getInstance().getServers(serverType));
DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
ConfigurationFactoryEx factory = configurationType.getFactory();
RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), factory);
DeployToServerRunConfiguration<?, ?> runConfiguration = (DeployToServerRunConfiguration<?, ?>) settings.getConfiguration();
if (server != null) {
runConfiguration.setServerName(server.getName());
}
runManager.addConfiguration(settings, false);
}
}
Aggregations