[json + remdev] IJPL-176240 Add json.backend dependency for any third-party plugin that declares dependency on the json plugin id

This is required for the case when external developers have their plugin implemented using plugin model v2, meaning that dependency on the JSON plugin id is not enough to have access to classes from the backend module. This module contains json schema-related code, which is the most popular extension point, so we have to make sure users are able to access them in runtime. With the change monolith-compatible third party plugins do not require any additional changes to be able to work with the updated json plugin layout

GitOrigin-RevId: 8ba8b392e62c9caff9a86d3bb847c9b55aafbf8f
This commit is contained in:
Nikita Katkov
2025-03-13 20:28:08 +01:00
committed by intellij-monorepo-bot
parent 1393d86af9
commit 5074c175e7

View File

@@ -11,6 +11,7 @@ private val VCS_ALIAS_ID = PluginId.getId("com.intellij.modules.vcs")
private val RIDER_ALIAS_ID = PluginId.getId("com.intellij.modules.rider")
private val COVERAGE_ALIAS_ID = PluginId.getId("com.intellij.modules.coverage")
private val ML_INLINE_ALIAS_ID = PluginId.getId("com.intellij.ml.inline.completion")
private val JSON_ALIAS_ID = PluginId.getId("com.intellij.modules.json")
internal class ModulesWithDependencies(val modules: List<IdeaPluginDescriptorImpl>,
val directDependencies: Map<IdeaPluginDescriptorImpl, List<IdeaPluginDescriptorImpl>>) {
@@ -79,6 +80,10 @@ internal fun createModulesWithDependenciesAndAdditionalEdges(plugins: Collection
if (!strictCheck) {
if (System.getProperty("enable.implicit.json.dependency").toBoolean()) {
moduleMap.get("com.intellij.modules.json")?.let { dependenciesCollector.add(it) }
moduleMap.get("intellij.json.backend")?.let { dependenciesCollector.add(it) }
}
if (doesDependOnPluginAlias(module, JSON_ALIAS_ID)) {
moduleMap.get("intellij.json.backend")?.let { dependenciesCollector.add(it) }
}
moduleMap.get("intellij.platform.collaborationTools")?.let { dependenciesCollector.add(it) }
}