Search in sources :

Example 6 with CloudSdkService

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");
}
Also used : UserSpecifiedPathDeploymentSource(com.google.cloud.tools.intellij.appengine.cloud.flexible.UserSpecifiedPathDeploymentSource) CloudSdkService(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService) RuntimeConfigurationError(com.intellij.execution.configurations.RuntimeConfigurationError) SdkStatus(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus) CloudSdkValidationResult(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkValidationResult)

Example 7 with CloudSdkService

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);
}
Also used : MutablePicoContainer(org.picocontainer.MutablePicoContainer) CloudSdkInternals(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkInternals) CloudSdkService(com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService)

Aggregations

CloudSdkService (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService)7 CloudSdkInternals (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkInternals)3 SdkStatus (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkService.SdkStatus)2 RuntimeConfigurationError (com.intellij.execution.configurations.RuntimeConfigurationError)2 MutablePicoContainer (org.picocontainer.MutablePicoContainer)2 CloudSdk (com.google.cloud.tools.appengine.cloudsdk.CloudSdk)1 CloudSdkAppEngineDevServer1 (com.google.cloud.tools.appengine.cloudsdk.CloudSdkAppEngineDevServer1)1 UserSpecifiedPathDeploymentSource (com.google.cloud.tools.intellij.appengine.cloud.flexible.UserSpecifiedPathDeploymentSource)1 AppEngineStandardMavenLibrary (com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardMavenLibrary)1 AppEngineSupportConfigurable (com.google.cloud.tools.intellij.appengine.facet.standard.AppEngineStandardSupportProvider.AppEngineSupportConfigurable)1 MavenRepositoryLibraryDownloader (com.google.cloud.tools.intellij.appengine.facet.standard.MavenRepositoryLibraryDownloader)1 CloudSdkServiceManager (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkServiceManager)1 CloudSdkValidationResult (com.google.cloud.tools.intellij.appengine.sdk.CloudSdkValidationResult)1 AppEngineServerIntegration (com.google.cloud.tools.intellij.appengine.server.integration.AppEngineServerIntegration)1 ParametersList (com.intellij.execution.configurations.ParametersList)1 FrameworkSupportInModuleConfigurable (com.intellij.framework.addSupport.FrameworkSupportInModuleConfigurable)1 ApplicationServer (com.intellij.javaee.appServerIntegrations.ApplicationServer)1 JavaeePersistentData (com.intellij.javaee.oss.server.JavaeePersistentData)1 Module (com.intellij.openapi.module.Module)1 File (java.io.File)1