in ideaSupport/src/main/scala/org/jetbrains/sbtidea/tasks/classpath/PluginClasspathUtils.scala [49:73]
def collectPluginRoots(
ideaBaseDir: Path,
ideaBuildInfo: BuildInfo,
plugins: Seq[IntellijPlugin],
log: PluginLogger,
moduleNameHint: String = ""
): Seq[(PluginDescriptor, Path)] = {
implicit val context: IdeInstallationProcessContext = new IdeInstallationProcessContext(
baseDirectory = ideaBaseDir,
// We rely on that the plugins are already downloaded and this directory won't be actually used
// (Don't want to pass the value of org.jetbrains.sbtidea.Keys.artifactsDownloadsDir here)
artifactsDownloadsDir = ideaBaseDir.getParent / "downloads"
)
implicit val remoteRepoApi: PluginRepoUtils = new PluginRepoUtils
implicit val localRegistry: LocalPluginRegistry = new LocalPluginRegistry(context)
PluginLogger.bind(log)
val resolved = plugins.map(pl => PluginDependency(pl, ideaBuildInfo, Seq.empty).resolve)
reportPluginDuplicates(resolved, moduleNameHint, log)
val allDependencies = resolved.flatten
val roots = allDependencies.collect { case LocalPlugin(_, descriptor, root, _) => descriptor -> root }.distinct
roots
}