use of com.google.cloud.tools.managedcloudsdk.ConsoleListener in project google-cloud-intellij by GoogleCloudPlatform.
the class ManagedCloudSdkService method installSdk.
/**
* Installs core managed SDK if needed and returns its path if successful.
*/
private ManagedSdkJobResult installSdk() throws Exception {
if (!safeCheckSdkStatus(() -> managedCloudSdk.isInstalled())) {
ConsoleListener sdkConsoleListener = logger::debug;
progressListener = ManagedCloudSdkServiceUiPresenter.getInstance().createProgressListener(this);
managedCloudSdk.newInstaller().install(progressListener, sdkConsoleListener);
return ManagedSdkJobResult.PROCESSED;
}
return ManagedSdkJobResult.UP_TO_DATE;
}
use of com.google.cloud.tools.managedcloudsdk.ConsoleListener in project google-cloud-intellij by GoogleCloudPlatform.
the class ManagedCloudSdkService method installAppEngineJavaComponent.
private ManagedSdkJobResult installAppEngineJavaComponent() throws Exception {
if (!safeCheckSdkStatus(() -> managedCloudSdk.hasComponent(SdkComponent.APP_ENGINE_JAVA))) {
ConsoleListener appEngineConsoleListener = logger::debug;
progressListener = ManagedCloudSdkServiceUiPresenter.getInstance().createProgressListener(this);
managedCloudSdk.newComponentInstaller().installComponent(SdkComponent.APP_ENGINE_JAVA, progressListener, appEngineConsoleListener);
return ManagedSdkJobResult.PROCESSED;
} else {
return ManagedSdkJobResult.UP_TO_DATE;
}
}
use of com.google.cloud.tools.managedcloudsdk.ConsoleListener in project google-cloud-intellij by GoogleCloudPlatform.
the class ManagedCloudSdkService method updateManagedSdk.
private ManagedSdkJobResult updateManagedSdk() throws Exception {
if (!safeCheckSdkStatus(() -> managedCloudSdk.isUpToDate())) {
ConsoleListener sdkUpdateListener = logger::debug;
progressListener = ManagedCloudSdkServiceUiPresenter.getInstance().createProgressListener(this);
managedCloudSdk.newUpdater().update(progressListener, sdkUpdateListener);
return ManagedSdkJobResult.PROCESSED;
} else {
return ManagedSdkJobResult.UP_TO_DATE;
}
}
use of com.google.cloud.tools.managedcloudsdk.ConsoleListener in project app-maven-plugin by GoogleCloudPlatform.
the class CloudSdkDownloader method downloadCloudSdk.
/**
* Downloads/installs/updates the Cloud SDK
*
* @return The cloud SDK installation directory
*/
public Path downloadCloudSdk(Log log) {
try {
ProgressListener progressListener = new NoOpProgressListener();
ConsoleListener consoleListener = new CloudSdkDownloaderConsoleListener(log);
if (!managedCloudSdk.isInstalled()) {
managedCloudSdk.newInstaller().install(progressListener, consoleListener);
}
if (!managedCloudSdk.hasComponent(SdkComponent.APP_ENGINE_JAVA)) {
managedCloudSdk.newComponentInstaller().installComponent(SdkComponent.APP_ENGINE_JAVA, progressListener, consoleListener);
}
if (!managedCloudSdk.isUpToDate()) {
managedCloudSdk.newUpdater().update(progressListener, consoleListener);
}
return managedCloudSdk.getSdkHome();
} catch (IOException | SdkInstallerException | ManagedSdkVersionMismatchException | InterruptedException | CommandExecutionException | CommandExitException | ManagedSdkVerificationException ex) {
throw new RuntimeException(ex);
}
}
Aggregations