private static void migrateGlobalPlugins(Path newConfigDir,
                                           Path oldConfigDir,
                                           List<IdeaPluginDescriptor> toMigrate,
                                           List<IdeaPluginDescriptor> toDownload,
                                           Logger log) {
    var currentProductVersion = PluginManagerCore.getBuildNumber().asStringWithoutProductCode();
    String previousVersion = parseVersionFromConfig(oldConfigDir);

    var options = new PluginMigrationOptions(previousVersion, currentProductVersion,
                                             newConfigDir, oldConfigDir,
                                             toMigrate, toDownload,
                                             log);

    performMigrations(options);

    var downloadIds = toDownload.stream()
      .map(descriptor -> descriptor.getPluginId().getIdString())
      .collect(Collectors.joining("\n"));
    writeMigrationResult(newConfigDir, downloadIds, options.getLog());
  }
private static void migrateGlobalPlugins(Path newConfigDir,
                                           Path oldConfigDir,
                                           List<IdeaPluginDescriptor> toMigrate,
                                           List<IdeaPluginDescriptor> toDownload,
                                           Logger log)