use of com.google.cloud.tools.intellij.appengine.server.run.AppEngineServerConfigurationType in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineStandardUltimateWebIntegration method setupLocalDevRunConfiguration.
private void setupLocalDevRunConfiguration(Artifact artifact, @NotNull Project project, ModuleRunConfiguration existingConfiguration) {
final ApplicationServer appServer = getOrCreateAppServer();
if (appServer != null) {
AppEngineServerConfigurationType configurationType = AppEngineServerConfigurationType.getInstance();
CommonModel configuration;
if (existingConfiguration instanceof CommonModel && ((CommonModel) existingConfiguration).getServerModel() instanceof AppEngineServerModel) {
configuration = (CommonModel) existingConfiguration;
} else if (RunManager.getInstance(project).getConfigurationSettingsList(configurationType).isEmpty()) {
final RunnerAndConfigurationSettings settings = J2EEConfigurationFactory.getInstance().addAppServerConfiguration(project, configurationType.getLocalFactory(), appServer);
configuration = (CommonModel) settings.getConfiguration();
} else {
configuration = null;
}
if (artifact != null && configuration != null && configuration.getServerModel() instanceof AppEngineServerModel) {
((AppEngineServerModel) configuration.getServerModel()).setArtifact(artifact);
BuildArtifactsBeforeRunTaskProvider.setBuildArtifactBeforeRun(project, configuration, artifact);
}
}
}
Aggregations