Search in sources :

Example 1 with PluginInfoService

use of com.google.cloud.tools.intellij.service.PluginInfoService in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudSdkAppEngineHelper method createSdk.

@Override
public CloudSdk createSdk(LoggingHandler loggingHandler, ProcessStartListener startListener, ProcessOutputLineListener logListener, ProcessOutputLineListener outputListener, ProcessExitListener exitListener) {
    if (credentialsPath == null) {
        loggingHandler.print(GctBundle.message("appengine.action.credential.not.found") + "\n");
        throw new AppEngineException("Failed to create application default credentials.");
    }
    PluginInfoService pluginInfoService = ServiceManager.getService(PluginInfoService.class);
    CloudSdk.Builder sdkBuilder = new CloudSdk.Builder().sdkPath(CloudSdkService.getInstance().getSdkHomePath()).async(true).addStdErrLineListener(logListener).addStdOutLineListener(outputListener).exitListener(exitListener).startListener(startListener).appCommandCredentialFile(credentialsPath.toFile()).appCommandMetricsEnvironment(pluginInfoService.getExternalPluginName()).appCommandMetricsEnvironmentVersion(pluginInfoService.getPluginVersion()).appCommandOutputFormat("json");
    getProjectJavaSdk(project).ifPresent(sdkBuilder::javaHome);
    return sdkBuilder.build();
}
Also used : PluginInfoService(com.google.cloud.tools.intellij.service.PluginInfoService) CloudSdk(com.google.cloud.tools.appengine.cloudsdk.CloudSdk) AppEngineException(com.google.cloud.tools.appengine.api.AppEngineException)

Example 2 with PluginInfoService

use of com.google.cloud.tools.intellij.service.PluginInfoService in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudToolsPluginInitializationComponent method initComponent.

@Override
public void initComponent() {
    if (!ApplicationManager.getApplication().isUnitTestMode()) {
        configureUsageTracking();
    }
    Services.getLoginService().loadPersistedCredentials();
    PluginConfigurationService pluginConfigurationService = ServiceManager.getService(PluginConfigurationService.class);
    PluginInfoService pluginInfoService = ServiceManager.getService(PluginInfoService.class);
    if (pluginInfoService.shouldEnableErrorFeedbackReporting()) {
        initErrorReporting(pluginConfigurationService, pluginInfoService);
    }
    new ConflictingAppEnginePluginCheck().notifyIfConflicting();
    new GoogleAccountPluginUninstaller().uninstallIfPresent();
    if (!ApplicationManager.getApplication().isUnitTestMode()) {
        ServiceManager.getService(CloudSdkServiceManager.class).getCloudSdkService().activate();
    }
}
Also used : PluginInfoService(com.google.cloud.tools.intellij.service.PluginInfoService) PluginConfigurationService(com.google.cloud.tools.intellij.service.PluginConfigurationService)

Aggregations

PluginInfoService (com.google.cloud.tools.intellij.service.PluginInfoService)2 AppEngineException (com.google.cloud.tools.appengine.api.AppEngineException)1 CloudSdk (com.google.cloud.tools.appengine.cloudsdk.CloudSdk)1 PluginConfigurationService (com.google.cloud.tools.intellij.service.PluginConfigurationService)1