public void downloadCloudSdkAction()

in app-gradle-plugin/src/main/java/com/google/cloud/tools/gradle/appengine/core/DownloadCloudSdkTask.java [62:96]


  public void downloadCloudSdkAction()
      throws ManagedSdkVerificationException, ManagedSdkVersionMismatchException,
          InterruptedException, CommandExecutionException, SdkInstallerException,
          CommandExitException, IOException {
    // managedCloudSdk is set by AppEngineCorePluginConfiguration if the cloud SDK home is empty
    if (managedCloudSdk == null) {
      throw new GradleException("Cloud SDK home path must not be configured to run this task.");
    }

    ProgressListener progressListener = new NoOpProgressListener();
    ConsoleListener consoleListener = new DownloadCloudSdkTaskConsoleListener(getProject());

    // Install sdk if not installed
    if (!managedCloudSdk.isInstalled()) {
      SdkInstaller installer = managedCloudSdk.newInstaller();
      installer.install(progressListener, consoleListener);
    }

    // install components
    if (components != null) {
      for (SdkComponent component : components) {
        if (!managedCloudSdk.hasComponent(component)) {
          managedCloudSdk
              .newComponentInstaller()
              .installComponent(component, progressListener, consoleListener);
        }
      }
    }

    // If version is set to LATEST, update Cloud SDK
    if (!managedCloudSdk.isUpToDate()) {
      SdkUpdater updater = managedCloudSdk.newUpdater();
      updater.update(progressListener, consoleListener);
    }
  }