mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2026-11-05 15:19:12 +01:00
IJPL-257728 removed intellij.platform.kernel, kernel.impl and kernel.backend from the platform. On builds from master, IdeaVIM.ideavim-backend and both bookmark backend modules declared a dependency on intellij.platform.kernel.backend, so the platform skipped them silently. None of the remoteApiProvider extensions got registered, and Commentary, Format and the other RPC calls failed with "No remote API found". IdeaVim doesn't use any class from these modules. The backend-only loading in split mode is still provided by the dependency on intellij.platform.backend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
98 lines
3.2 KiB
Kotlin
98 lines
3.2 KiB
Kotlin
/*
|
|
* Copyright 2003-2026 The IdeaVim authors
|
|
*
|
|
* Use of this source code is governed by an MIT-style
|
|
* license that can be found in the LICENSE.txt file or at
|
|
* https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
plugins {
|
|
java
|
|
kotlin("jvm")
|
|
id("org.jetbrains.intellij.platform.module")
|
|
id("com.google.devtools.ksp")
|
|
}
|
|
|
|
val fleetRpcVersion: String by project
|
|
|
|
val kotlinVersion: String by project
|
|
val ideaType: String by project
|
|
val ideaVersion: String by project
|
|
val javaVersion: String by project
|
|
|
|
val ideaBranchNumber = ideaVersion.substringBefore('-').split('.').let { parts ->
|
|
val head = parts[0].toIntOrNull() ?: Int.MAX_VALUE // LATEST-EAP-SNAPSHOT
|
|
val isProductVersion = head > 1000 // 2026.2 rather than 262.8665.258
|
|
if (isProductVersion) (head % 100) * 10 + (parts.getOrNull(1)?.toIntOrNull() ?: 1) else head
|
|
}
|
|
|
|
// intellij.platform.rpc has a module descriptor since 2026.1; in 2025.3 its classes are in the core and
|
|
// product-info.json doesn't list it, which fails resolution.
|
|
val rpcModuleExists = ideaBranchNumber >= 261
|
|
|
|
repositories {
|
|
maven { url = uri("https://cache-redirector.jetbrains.com/repo.maven.apache.org/maven2") }
|
|
maven("https://cache-redirector.jetbrains.com/packages.jetbrains.team/maven/p/ij/intellij-dependencies")
|
|
|
|
intellijPlatform {
|
|
defaultRepositories()
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// No dependency on root project (":") to avoid circular dependency.
|
|
// The root project declares this module via pluginModule(), and loading="embedded"
|
|
// ensures classes are visible at runtime.
|
|
api(project(":vim-engine"))
|
|
api(project(":api"))
|
|
ksp(project(":annotation-processors"))
|
|
compileOnly(project(":annotation-processors"))
|
|
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
|
|
compileOnly("org.jetbrains:annotations:26.1.0")
|
|
kotlinCompilerPluginClasspath("org.jetbrains.kotlin:kotlin-serialization-compiler-plugin:$kotlinVersion")
|
|
kotlinCompilerPluginClasspath("com.jetbrains.fleet:rpc-compiler-plugin:$fleetRpcVersion")
|
|
|
|
intellijPlatform {
|
|
var useInstaller = "EAP-SNAPSHOT" !in ideaVersion
|
|
if (ideaType == "RD") {
|
|
useInstaller = false
|
|
}
|
|
|
|
create(ideaType, ideaVersion) { this.useInstaller = useInstaller }
|
|
|
|
bundledModule("intellij.spellchecker")
|
|
if (rpcModuleExists) bundledModule("intellij.platform.rpc")
|
|
}
|
|
}
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
|
}
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
|
}
|
|
|
|
compilerOptions {
|
|
// Must follow javaVersion: this module inlines platform bytecode (Fleet RPC RemoteApi),
|
|
// which on newer platforms (2026.1 / EAP) is built for JVM target 25. A lower target here
|
|
// fails with "Cannot inline bytecode built with JVM target 25 into bytecode ... target 21".
|
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(javaVersion))
|
|
freeCompilerArgs = listOf("-Xjvm-default=all-compatibility")
|
|
}
|
|
}
|
|
|
|
ksp {
|
|
arg("generated_directory", "$projectDir/src/main/resources/ksp-generated")
|
|
arg("vimscript_functions_file", "intellij_vimscript_functions.json")
|
|
arg("ex_commands_file", "intellij_ex_commands.json")
|
|
arg("commands_file", "intellij_commands.json")
|
|
}
|
|
|
|
afterEvaluate {
|
|
tasks.named("kspTestKotlin").configure { enabled = false }
|
|
}
|