use of com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineDeploymentConfiguration method checkCommonConfig.
private void checkCommonConfig(AppEngineDeployable deployable) throws RuntimeConfigurationError {
// do not check SDK if it supports dynamic install - the deployment runner will block itself
// until installation is done.
CloudSdkService cloudSdkService = CloudSdkService.getInstance();
SdkStatus sdkStatus = cloudSdkService.getStatus();
if (sdkStatus != SdkStatus.READY && !cloudSdkService.isInstallSupported()) {
Set<CloudSdkValidationResult> sdkValidationResult = CloudSdkValidator.getInstance().validateCloudSdk();
if (!sdkValidationResult.isEmpty()) {
CloudSdkValidationResult result = Iterables.getFirst(sdkValidationResult, null);
throw new RuntimeConfigurationError(GctBundle.message("appengine.flex.config.server.error", result.getMessage()));
}
}
check(deployable instanceof UserSpecifiedPathDeploymentSource || deployable.isValid(), "appengine.config.deployment.source.error");
check(StringUtils.isNotBlank(cloudProjectName), "appengine.flex.config.project.missing.message");
}
use of com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineCodeInsightTestCase method addAppEngineSupport.
private void addAppEngineSupport(Module module) {
CloudSdkService sdkService = mock(CloudSdkService.class);
CloudSdkInternals mockSdkInternals = mock(CloudSdkInternals.class);
when(mockSdkInternals.getWebSchemeFile()).thenReturn(getWebSchemeFile());
CloudSdkInternals.setInstance(mockSdkInternals);
MutablePicoContainer applicationContainer = (MutablePicoContainer) ApplicationManager.getApplication().getPicoContainer();
applicationContainer.unregisterComponent(CloudSdkService.class.getName());
applicationContainer.registerComponentInstance(CloudSdkService.class.getName(), sdkService);
FacetManager.getInstance(module).addFacet(AppEngineStandardFacet.getFacetType(), "AppEngine", null);
}
Aggregations