From cf635fff1f273f0de2bc722e820a55ab7e8edc0a Mon Sep 17 00:00:00 2001 From: Oleksandr Liemiahov Date: Thu, 16 Jul 2026 11:50:15 +0300 Subject: [PATCH] fix installation --- ...ellij-plugin-module-conventions.gradle.kts | 26 +++++++++++++++++++ .../META-INF/rider-platform-modules.xml | 7 ----- intellij-plugin/hs-CSharp/build.gradle.kts | 21 +++++++++++++++ .../hs-CSharp/resources/hs-CSharp.xml | 9 +++---- 4 files changed, 50 insertions(+), 13 deletions(-) delete mode 100644 intellij-plugin/hs-CSharp/branches/262/resources/META-INF/rider-platform-modules.xml diff --git a/buildSrc/src/main/kotlin/intellij-plugin-module-conventions.gradle.kts b/buildSrc/src/main/kotlin/intellij-plugin-module-conventions.gradle.kts index 343b7a0ae..c06ac3cc8 100644 --- a/buildSrc/src/main/kotlin/intellij-plugin-module-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/intellij-plugin-module-conventions.gradle.kts @@ -1,5 +1,6 @@ import org.gradle.jvm.tasks.Jar import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform +import java.util.zip.ZipFile plugins { id("intellij-plugin-common-conventions") @@ -36,6 +37,31 @@ afterEvaluate { } } +val verifyModuleDescriptor = tasks.register("verifyModuleDescriptor") { + val composedJar = tasks.named("composedJar") + inputs.file(composedJar.flatMap { it.archiveFile }) + doLast { + val archive = composedJar.get().archiveFile.get().asFile + ZipFile(archive).use { zip -> + val descriptors = zip.entries().asSequence().filter { entry -> + !entry.isDirectory && '/' !in entry.name && entry.name.endsWith(".xml") + } + for (descriptor in descriptors) { + val content = zip.getInputStream(descriptor).bufferedReader().use { it.readText() } + check(!Regex("""<\s*xi:include\b""").containsMatchIn(content)) { + "Module descriptor `${archive.name}!/${descriptor.name}` contains an XInclude. " + + "IntelliJ loads descriptors from separate module JARs without an XInclude path resolver; " + + "generate a flattened descriptor instead." + } + } + } + } +} + +tasks.named("composedJar") { + finalizedBy(verifyModuleDescriptor) +} + fun findModuleDescriptorName(): String? { val resourcesDirs = sourceSets.main.get().resources.srcDirs for (resourcesDir in resourcesDirs) { diff --git a/intellij-plugin/hs-CSharp/branches/262/resources/META-INF/rider-platform-modules.xml b/intellij-plugin/hs-CSharp/branches/262/resources/META-INF/rider-platform-modules.xml deleted file mode 100644 index c5e5c5b0d..000000000 --- a/intellij-plugin/hs-CSharp/branches/262/resources/META-INF/rider-platform-modules.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/intellij-plugin/hs-CSharp/build.gradle.kts b/intellij-plugin/hs-CSharp/build.gradle.kts index 24103c20b..e53749f2d 100644 --- a/intellij-plugin/hs-CSharp/build.gradle.kts +++ b/intellij-plugin/hs-CSharp/build.gradle.kts @@ -2,6 +2,18 @@ plugins { id("intellij-plugin-module-conventions") } +private val riderPlatformModuleDependenciesMarker = "" +private val riderPlatformModuleDependencies = if (environmentName.toInt() >= 262) { + listOf( + "intellij.rd.client", + "intellij.rider.languages", + "intellij.rider.rdclient.dotnet", + ).joinToString("\n") { " " } +} +else { + "" +} + dependencies { intellijPlatform { intellijIde(riderVersion) @@ -23,6 +35,15 @@ dependencies { } tasks { + processResources { + inputs.property("riderPlatformModuleDependencies", riderPlatformModuleDependencies) + filesMatching("hs-CSharp.xml") { + filter { line -> + if (riderPlatformModuleDependenciesMarker in line) riderPlatformModuleDependencies else line + } + } + } + // Tests are disabled due to failures on TeamCity with 2025.2+ // Rider's testFramework.jar location differs from other IDEs // TODO: EDU-XXXX - investigate and fix CSharp test failures diff --git a/intellij-plugin/hs-CSharp/resources/hs-CSharp.xml b/intellij-plugin/hs-CSharp/resources/hs-CSharp.xml index 7a6f81663..1ab970a0d 100644 --- a/intellij-plugin/hs-CSharp/resources/hs-CSharp.xml +++ b/intellij-plugin/hs-CSharp/resources/hs-CSharp.xml @@ -1,16 +1,13 @@ - + + + - - - - - messages.EduCoreBundle