Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -36,6 +37,31 @@ afterEvaluate {
}
}

val verifyModuleDescriptor = tasks.register("verifyModuleDescriptor") {
val composedJar = tasks.named<Jar>("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<Jar>("composedJar") {
finalizedBy(verifyModuleDescriptor)
}

fun findModuleDescriptorName(): String? {
val resourcesDirs = sourceSets.main.get().resources.srcDirs
for (resourcesDir in resourcesDirs) {
Expand Down

This file was deleted.

21 changes: 21 additions & 0 deletions intellij-plugin/hs-CSharp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ plugins {
id("intellij-plugin-module-conventions")
}

private val riderPlatformModuleDependenciesMarker = "<!-- RIDER_PLATFORM_MODULE_DEPENDENCIES -->"
private val riderPlatformModuleDependencies = if (environmentName.toInt() >= 262) {
listOf(
"intellij.rd.client",
"intellij.rider.languages",
"intellij.rider.rdclient.dotnet",
).joinToString("\n") { " <module name=\"$it\"/>" }
}
else {
""
}

dependencies {
intellijPlatform {
intellijIde(riderVersion)
Expand All @@ -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
Expand Down
9 changes: 3 additions & 6 deletions intellij-plugin/hs-CSharp/resources/hs-CSharp.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<idea-plugin xmlns:xi="http://www.w3.org/2001/XInclude" package="org.hyperskill.academy.csharp">
<idea-plugin package="org.hyperskill.academy.csharp">
<!--suppress PluginXmlValidity -->
<dependencies>
<plugin id="com.intellij.modules.rider"/>
<plugin id="com.intellij.resharper.unity"/>
<module name="intellij.rider"/>
<!-- Rider 2026.2+ module dependencies are inserted here by build.gradle.kts. -->
<!-- RIDER_PLATFORM_MODULE_DEPENDENCIES -->
</dependencies>

<!-- Rider 2026.2 splits these APIs out of `intellij.rider`. -->
<xi:include href="/META-INF/rider-platform-modules.xml">
<xi:fallback/>
</xi:include>

<resource-bundle>messages.EduCoreBundle</resource-bundle>

<actions>
Expand Down
Loading