From 94d14b856606b882a289bde384bfd0ce53cba3d9 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 13 Nov 2025 13:45:37 +0100 Subject: [PATCH] IJPL-217839 introduce pycharmCoreFragment (required to get rid of a nested and not controlled include of PlatformLangPlugin.xml) GitOrigin-RevId: 04175b46c183138445b7c9223d5286dd9062bdc6 --- .../CommunityProductFragments.kt | 26 +++++++++++++++++++ .../pycharm/PyCharmCommunityProperties.kt | 9 +++---- .../resources/META-INF/PyCharmCorePlugin.xml | 7 ++++- python/resources/META-INF/pycharm-core.xml | 10 +++---- 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/platform/build-scripts/src/org/jetbrains/intellij/build/productLayout/CommunityProductFragments.kt b/platform/build-scripts/src/org/jetbrains/intellij/build/productLayout/CommunityProductFragments.kt index fd32a21788f5..e846cea6c905 100644 --- a/platform/build-scripts/src/org/jetbrains/intellij/build/productLayout/CommunityProductFragments.kt +++ b/platform/build-scripts/src/org/jetbrains/intellij/build/productLayout/CommunityProductFragments.kt @@ -42,4 +42,30 @@ object CommunityProductFragments { // Extensions block (UTM tracking, new UI onboarding) deprecatedInclude("intellij.java.ide.resources", "META-INF/JavaIdePlugin.xml") } + + /** + * PyCharm Core fragment: provides PyCharm-specific platform extensions. + * + * Includes: + * - Platform language support (via platformLangBaseFragment) + * - Module capability alias for PyCharm + * - Optional remote servers support + * - PyCharm-specific extensions and actions (via pycharm-core.xml) + * + * Use this fragment for products that include PyCharm functionality (PyCharm Community, PyCharm Professional, DataSpell). + * Note: The extensions and actions blocks remain in pycharm-core.xml as they cannot be represented in the product content DSL. + */ + fun pycharmCoreFragment(): ProductModulesContentSpec = productModules { + // Include platform lang base (PyCharm requires platform language support) + include(platformLangBaseFragment()) + + // Module capability alias + alias("com.intellij.modules.pycharm") + + // Optional remote servers support + deprecatedInclude("intellij.platform.remoteServers.impl", "intellij.platform.remoteServers.impl.xml", optional = true) + + // Extensions and actions block (PyCharm-specific customization) + deprecatedInclude("intellij.pycharm.community", "META-INF/pycharm-core.xml") + } } diff --git a/python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt b/python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt index fb0260e7c123..1a830e0c356a 100644 --- a/python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt +++ b/python/build/src/org/jetbrains/intellij/build/pycharm/PyCharmCommunityProperties.kt @@ -7,10 +7,7 @@ import kotlinx.collections.immutable.plus import org.jetbrains.intellij.build.* import org.jetbrains.intellij.build.impl.qodana.QodanaProductProperties import org.jetbrains.intellij.build.io.copyFileToDir -import org.jetbrains.intellij.build.productLayout.CommunityModuleSets -import org.jetbrains.intellij.build.productLayout.ModuleSetProvider -import org.jetbrains.intellij.build.productLayout.ProductModulesContentSpec -import org.jetbrains.intellij.build.productLayout.productModules +import org.jetbrains.intellij.build.productLayout.* import java.nio.file.Files import java.nio.file.Path @@ -68,9 +65,11 @@ open class PyCharmCommunityProperties(protected val communityHome: Path) : PyCha moduleSet(CommunityModuleSets.ideCommon()) moduleSet(CommunityModuleSets.rdCommon()) + // PyCharm Core fragment (includes platformLangBaseFragment, module aliases, and pycharm-core.xml) + include(CommunityProductFragments.pycharmCoreFragment()) + // Static includes deprecatedInclude("intellij.platform.extended.community.impl", "META-INF/community-extensions.xml", ultimateOnly = true) - deprecatedInclude("intellij.pycharm.community", "META-INF/pycharm-core.xml") deprecatedInclude("intellij.pycharm.community", "META-INF/pycharm-core-customization.xml") } diff --git a/python/ide-common/resources/META-INF/PyCharmCorePlugin.xml b/python/ide-common/resources/META-INF/PyCharmCorePlugin.xml index 63a0098fa445..41ebefd85c0c 100644 --- a/python/ide-common/resources/META-INF/PyCharmCorePlugin.xml +++ b/python/ide-common/resources/META-INF/PyCharmCorePlugin.xml @@ -2,14 +2,19 @@ + - + + + + + diff --git a/python/resources/META-INF/pycharm-core.xml b/python/resources/META-INF/pycharm-core.xml index 6c7c6c4f5488..4040283dc110 100644 --- a/python/resources/META-INF/pycharm-core.xml +++ b/python/resources/META-INF/pycharm-core.xml @@ -1,12 +1,10 @@ - + - + Both Community and Professional editions. - - - + Note: Module alias, PlatformLangPlugin.xml, and remoteServers includes are provided by + CommunityProductFragments.pycharmCoreFragment() in product definitions. -->