From 2d050772a0b834bd67df5c2de81b9e47da8ee671 Mon Sep 17 00:00:00 2001 From: Nikolay Chashnikov Date: Fri, 7 Feb 2025 12:42:10 +0100 Subject: [PATCH] [json] extract explicit main module from plugin.xml for JSON plugin (IJPL-176240) This is needed to enable automatic layout and to allow merging two JSON plugins to a single one. Also, this is needed to allow adding dependency on JSON from the unified YAML plugin. 'intellij.json' is registered as an embedded content module, so it uses the main plugin classloader, and now has a dependency on 'intellij.json.split' module. This ensures that classes from both modules are available to content modules from other plugins which declare dependency on JSON plugin as before. After this change, build scripts don't put intellij.toml.json to a separate JAR anymore, and an explicit adjustment is needed in the Wiremock plugin's layout to avoid creating an unnecessary separate JAR. GitOrigin-RevId: be77513b7f0c1e397b4f6dda7524aa6978fa2a90 --- json/intellij.json.iml | 1 + json/plugin-content.yaml | 10 +++---- json/resources/META-INF/plugin.xml | 22 ++++++++++++++ json/resources/intellij.json.xml | 29 +++++-------------- ...CodeStyleSettingsCustomDataSynchronizer.kt | 3 ++ .../build/CommunityRepositoryModules.kt | 3 -- plugins/toml/plugin-content.yaml | 4 +-- 7 files changed, 39 insertions(+), 33 deletions(-) create mode 100644 json/resources/META-INF/plugin.xml diff --git a/json/intellij.json.iml b/json/intellij.json.iml index 65d4ee1c2d87..908fd9dad16c 100644 --- a/json/intellij.json.iml +++ b/json/intellij.json.iml @@ -19,6 +19,7 @@ + diff --git a/json/plugin-content.yaml b/json/plugin-content.yaml index e6028781ad8f..9b1138d4d663 100644 --- a/json/plugin-content.yaml +++ b/json/plugin-content.yaml @@ -1,9 +1,9 @@ - name: lib/frontend-split/json-frontend.jar modules: - name: intellij.json.frontend -- name: lib/json-split.jar - modules: - - name: intellij.json.split - name: lib/json.jar - modules: - - name: intellij.json \ No newline at end of file + contentModules: + - name: intellij.json +- name: lib/modules/intellij.json.split.jar + contentModules: + - name: intellij.json.split \ No newline at end of file diff --git a/json/resources/META-INF/plugin.xml b/json/resources/META-INF/plugin.xml new file mode 100644 index 000000000000..c0694ac48401 --- /dev/null +++ b/json/resources/META-INF/plugin.xml @@ -0,0 +1,22 @@ + + JSON + + com.intellij.modules.json + JetBrains + Languages + JSON and + JSON Schema languages + ]]> + + + + + + + + + \ No newline at end of file diff --git a/json/resources/intellij.json.xml b/json/resources/intellij.json.xml index 283b46fae697..09c64debed11 100644 --- a/json/resources/intellij.json.xml +++ b/json/resources/intellij.json.xml @@ -1,24 +1,8 @@ - - - JSON - - com.intellij.modules.json - JetBrains - Languages - JSON and - JSON Schema languages - ]]> + - + - - - - + @@ -86,7 +70,7 @@ + implementationClass="com.jetbrains.jsonSchema.impl.inspections.JsonSchemaRefReferenceInspection"/> - + JSON @@ -145,7 +130,7 @@ - + diff --git a/json/split/src/com/intellij/json/split/JsonCodeStyleSettingsCustomDataSynchronizer.kt b/json/split/src/com/intellij/json/split/JsonCodeStyleSettingsCustomDataSynchronizer.kt index 7daddade423a..51b0d6e0a1c0 100644 --- a/json/split/src/com/intellij/json/split/JsonCodeStyleSettingsCustomDataSynchronizer.kt +++ b/json/split/src/com/intellij/json/split/JsonCodeStyleSettingsCustomDataSynchronizer.kt @@ -3,8 +3,11 @@ package com.intellij.json.split import com.intellij.json.JsonLanguage import com.intellij.json.formatter.JsonCodeStyleSettings +import com.intellij.openapi.extensions.InternalIgnoreDependencyViolation import com.intellij.psi.codeStyle.CodeStyleSettingsCustomDataSynchronizer +//todo split on two separate classes for the backend and the frontend +@InternalIgnoreDependencyViolation class JsonCodeStyleSettingsCustomDataSynchronizer : CodeStyleSettingsCustomDataSynchronizer() { override val language get() = JsonLanguage.INSTANCE diff --git a/platform/build-scripts/src/org/jetbrains/intellij/build/CommunityRepositoryModules.kt b/platform/build-scripts/src/org/jetbrains/intellij/build/CommunityRepositoryModules.kt index 604bbfb1bd79..debf397fa8b0 100644 --- a/platform/build-scripts/src/org/jetbrains/intellij/build/CommunityRepositoryModules.kt +++ b/platform/build-scripts/src/org/jetbrains/intellij/build/CommunityRepositoryModules.kt @@ -26,9 +26,6 @@ object CommunityRepositoryModules { * Specifies non-trivial layout for all plugins that sources are located in 'community' and 'contrib' repositories */ val COMMUNITY_REPOSITORY_PLUGINS: PersistentList = persistentListOf( - pluginAuto("intellij.json") { spec -> - spec.withModule("intellij.json.split", "json-split.jar") - }, plugin("intellij.ant") { spec -> spec.mainJarName = "antIntegration.jar" spec.withModule("intellij.ant.jps", "ant-jps.jar") diff --git a/plugins/toml/plugin-content.yaml b/plugins/toml/plugin-content.yaml index 65cd8d7feaa8..f838682a58c7 100644 --- a/plugins/toml/plugin-content.yaml +++ b/plugins/toml/plugin-content.yaml @@ -1,6 +1,3 @@ -- name: lib/modules/intellij.toml.json.jar - contentModules: - - name: intellij.toml.json - name: lib/toml-frontend.jar modules: - name: intellij.toml.core @@ -9,4 +6,5 @@ modules: - name: intellij.toml contentModules: + - name: intellij.toml.json - name: intellij.toml.grazie \ No newline at end of file