mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-866 modules -> pluginAliases (avoid confusion)
GitOrigin-RevId: 24b48f378f22679aa35dde1c2502707f9199b690
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e41540544b
commit
6079055a3f
@@ -160,7 +160,7 @@ class IdeaPluginDescriptorImpl(
|
||||
val dependencies: ModuleDependenciesDescriptor = raw.dependencies
|
||||
|
||||
@JvmField
|
||||
var modules: List<PluginId> = raw.modules ?: Java11Shim.INSTANCE.listOf()
|
||||
var pluginAliases: List<PluginId> = raw.pluginAliases ?: Java11Shim.INSTANCE.listOf()
|
||||
|
||||
private val descriptionChildText = raw.description
|
||||
|
||||
@@ -269,13 +269,13 @@ class IdeaPluginDescriptorImpl(
|
||||
}
|
||||
|
||||
if (id == PluginManagerCore.CORE_ID) {
|
||||
modules = modules + IdeaPluginOsRequirement.getHostOsModuleIds()
|
||||
pluginAliases = pluginAliases + IdeaPluginOsRequirement.getHostOsModuleIds()
|
||||
if (!AppMode.isRemoteDevHost()) {
|
||||
// Dependency on this ID may be used to enable some functionality in the local IDE
|
||||
// and in JetBrains Client, but disable it in product running in backend mode.
|
||||
// This is needed because the backend process currently doesn't use module-based loader and therefore cannot
|
||||
// use marker modules from ProductModes.
|
||||
modules = modules + PluginId.getId("com.intellij.platform.experimental.frontend")
|
||||
pluginAliases = pluginAliases + PluginId.getId("com.intellij.platform.experimental.frontend")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ internal fun createModuleGraph(plugins: Collection<IdeaPluginDescriptorImpl>): M
|
||||
val modules = ArrayList<IdeaPluginDescriptorImpl>(moduleMap.size)
|
||||
for (module in plugins) {
|
||||
moduleMap.put(module.pluginId.idString, module)
|
||||
for (v1Module in module.modules) {
|
||||
moduleMap.put(v1Module.idString, module)
|
||||
for (pluginAlias in module.pluginAliases) {
|
||||
moduleMap.put(pluginAlias.idString, module)
|
||||
}
|
||||
|
||||
modules.add(module)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
@file:Suppress("ReplaceGetOrSet", "ReplacePutWithAssignment")
|
||||
package com.intellij.ide.plugins
|
||||
|
||||
@@ -102,8 +102,8 @@ class PluginLoadingResult(private val checkModuleDependencies: Boolean = !Platfo
|
||||
val prevDescriptor = enabledPluginsById.put(pluginId, descriptor)
|
||||
if (prevDescriptor == null) {
|
||||
idMap.put(pluginId, descriptor)
|
||||
for (module in descriptor.modules) {
|
||||
checkAndAdd(descriptor, module)
|
||||
for (pluginAlias in descriptor.pluginAliases) {
|
||||
checkAndAdd(descriptor, pluginAlias)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -857,8 +857,9 @@ object PluginManagerCore {
|
||||
}
|
||||
|
||||
@Internal
|
||||
fun findPluginByModuleDependency(id: PluginId): IdeaPluginDescriptorImpl? =
|
||||
getPluginSet().allPlugins.firstOrNull { it.modules.contains(id) }
|
||||
fun findPluginByModuleDependency(id: PluginId): IdeaPluginDescriptorImpl? {
|
||||
return getPluginSet().allPlugins.firstOrNull { it.pluginAliases.contains(id) }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isPluginInstalled(id: PluginId): Boolean {
|
||||
@@ -877,8 +878,8 @@ object PluginManagerCore {
|
||||
duplicateMap = newDuplicateMap
|
||||
continue
|
||||
}
|
||||
for (module in descriptor.modules) {
|
||||
newDuplicateMap = checkAndPut(descriptor = descriptor, id = module, idMap = idMap, prevDuplicateMap = duplicateMap)
|
||||
for (pluginAlias in descriptor.pluginAliases) {
|
||||
newDuplicateMap = checkAndPut(descriptor = descriptor, id = pluginAlias, idMap = idMap, prevDuplicateMap = duplicateMap)
|
||||
if (newDuplicateMap != null) {
|
||||
duplicateMap = newDuplicateMap
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ class PluginSetBuilder(@JvmField val unsortedPlugins: Set<IdeaPluginDescriptorIm
|
||||
|
||||
if (module.moduleName == null) {
|
||||
enabledPluginIds.put(module.pluginId, module)
|
||||
for (v1Module in module.modules) {
|
||||
enabledPluginIds.put(v1Module, module)
|
||||
for (pluginAlias in module.pluginAliases) {
|
||||
enabledPluginIds.put(pluginAlias, module)
|
||||
}
|
||||
if (module.packagePrefix != null) {
|
||||
enabledModuleV2Ids.put(module.pluginId.idString, module)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.plugins
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionDescriptor
|
||||
@@ -39,7 +39,7 @@ class RawPluginDescriptor {
|
||||
@JvmField internal var releaseDate: LocalDate? = null
|
||||
@JvmField internal var releaseVersion: Int = 0
|
||||
|
||||
@JvmField internal var modules: MutableList<PluginId>? = null
|
||||
@JvmField internal var pluginAliases: MutableList<PluginId>? = null
|
||||
|
||||
@JvmField internal var depends: MutableList<PluginDependency>? = null
|
||||
@JvmField internal var actions: MutableList<ActionDescriptor>? = null
|
||||
|
||||
@@ -227,10 +227,10 @@ private fun readRootElementChild(reader: XMLStreamReader2,
|
||||
"product-descriptor" -> readProduct(reader, descriptor)
|
||||
"module" -> {
|
||||
findAttributeValue(reader, "value")?.let { moduleName ->
|
||||
if (descriptor.modules == null) {
|
||||
descriptor.modules = ArrayList()
|
||||
if (descriptor.pluginAliases == null) {
|
||||
descriptor.pluginAliases = ArrayList()
|
||||
}
|
||||
descriptor.modules!!.add(PluginId.getId(moduleName))
|
||||
descriptor.pluginAliases!!.add(PluginId.getId(moduleName))
|
||||
}
|
||||
reader.skipElement()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.target;
|
||||
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptorImpl;
|
||||
@@ -19,7 +19,7 @@ public final class RunTargetsEnabled {
|
||||
}
|
||||
|
||||
IdeaPluginDescriptorImpl corePluginDescriptor = (IdeaPluginDescriptorImpl)PluginManagerCore.getPlugin(PluginManagerCore.CORE_ID);
|
||||
return corePluginDescriptor != null && corePluginDescriptor.modules.contains(PluginId.getId("com.intellij.modules.run.targets"));
|
||||
return corePluginDescriptor != null && corePluginDescriptor.pluginAliases.contains(PluginId.getId("com.intellij.modules.run.targets"));
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.plugins
|
||||
|
||||
import com.fasterxml.jackson.core.JsonFactory
|
||||
@@ -42,7 +42,7 @@ private class BundledPluginsLister : ModernApplicationStarter() {
|
||||
val pluginIds = ArrayList<String>(plugins.size)
|
||||
for (plugin in plugins) {
|
||||
pluginIds.add(plugin.pluginId.idString)
|
||||
plugin.modules.mapTo(modules) { it.idString }
|
||||
plugin.pluginAliases.mapTo(modules) { it.idString }
|
||||
plugin.content.modules.mapTo(modules) { it.name }
|
||||
}
|
||||
pluginIds.sort()
|
||||
|
||||
@@ -173,7 +173,7 @@ public final class RepositoryHelper {
|
||||
|
||||
private static boolean isPaidPluginsRequireMarketplacePlugin() {
|
||||
var core = PluginManagerCore.findPlugin(PluginManagerCore.CORE_ID);
|
||||
return core == null || !core.modules.contains(PluginId.getId(ULTIMATE_MODULE)) || !ApplicationInfoImpl.getShadowInstance().isVendorJetBrains();
|
||||
return core == null || !core.pluginAliases.contains(PluginId.getId(ULTIMATE_MODULE)) || !ApplicationInfoImpl.getShadowInstance().isVendorJetBrains();
|
||||
}
|
||||
|
||||
private static void addMarketplacePluginDependencyIfRequired(PluginNode node, boolean isPaidPluginsRequireMarketplacePlugin) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.plugins.newui;
|
||||
|
||||
import com.intellij.externalDependencies.DependencyOnPlugin;
|
||||
@@ -983,8 +983,9 @@ public class MyPluginModel extends InstalledPluginsTableModel implements PluginE
|
||||
for (PluginId pluginId : requiredPluginIds) {
|
||||
IdeaPluginDescriptor result = ContainerUtil.find(view, d -> pluginId.equals(d.getPluginId()));
|
||||
if (result == null && PluginManagerCore.isModuleDependency(pluginId)) {
|
||||
result = ContainerUtil.find(view,
|
||||
d -> d instanceof IdeaPluginDescriptorImpl && ((IdeaPluginDescriptorImpl)d).modules.contains(pluginId));
|
||||
result = ContainerUtil.find(view, d -> {
|
||||
return d instanceof IdeaPluginDescriptorImpl && ((IdeaPluginDescriptorImpl)d).pluginAliases.contains(pluginId);
|
||||
});
|
||||
if (result != null) {
|
||||
setEnabled(pluginId, PluginEnabledState.ENABLED); // todo
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.plugins;
|
||||
|
||||
import com.intellij.openapi.extensions.PluginId;
|
||||
@@ -418,7 +418,7 @@ public class PluginManagerTest {
|
||||
sb.append("\n <idea-plugin url=\"file://out/").append(d.getPluginPath().getFileName().getParent()).append("/META-INF/plugin.xml\">");
|
||||
sb.append("\n <id>").append(escape.apply(d.getPluginId().getIdString())).append("</id>");
|
||||
sb.append("\n <name>").append(StringUtil.escapeXmlEntities(d.getName())).append("</name>");
|
||||
for (PluginId module : d.modules) {
|
||||
for (PluginId module : d.pluginAliases) {
|
||||
sb.append("\n <module value=\"").append(module.getIdString()).append("\"/>");
|
||||
}
|
||||
for (var dependency : d.pluginDependencies) {
|
||||
|
||||
Reference in New Issue
Block a user