def update()

in ideaSupport/src/main/scala/org/jetbrains/sbtidea/download/CommunityUpdater.scala [100:128]


  def update(): Unit = {
    // Example: "~/.ScalaPluginIC/sdk"
    // (see org.jetbrains.sbtidea.Init.buildSettings)
    // NOTE: it's a dirty implicit dependency on the logic in buildSettings, but should be enough in practice
    // I want to avoid introducing extra keys or parameters. We can change it at any time if needed.
    val sdksRootDir = baseDirectory.getParent
    if (Files.isDirectory(sdksRootDir)) {
      new OldSdkCleanup(log).detectOldSdksRemoveIfNeeded(sdksRootDir, autoRemove = autoRemoveOldIntellijSdk)
    }

    // Clean up old downloads in the artifact downloads directory
    if (Files.isDirectory(artifactsDownloadsDirectory)) {
      new OldDownloadsCleanup(log).detectOldDownloadsRemoveIfNeeded(artifactsDownloadsDirectory, autoRemove = autoRemoveOldDownloads)
    }

    val dependenciesSorted = topoSort(dependencies)
    dependenciesSorted.foreach(update)

    val actualBuildNumber = context.productInfo.buildNumber
    val buildNumber = ideaBuildInfo.buildNumber
    if (buildNumber != actualBuildNumber) {
      log.warn(
        s"""### Installed build number is different form the original build number
           |### Installed : $actualBuildNumber
           |### Original  : $buildNumber
           |""".stripMargin.trim
      )
    }
  }