Skip to content

fix: resolve local Gradle build against IntelliJ IDEA 2026.2 - #996

Open
catatafishen wants to merge 1 commit into
masterfrom
fix/gradle-2026-2-local-build
Open

fix: resolve local Gradle build against IntelliJ IDEA 2026.2#996
catatafishen wants to merge 1 commit into
masterfrom
fix/gradle-2026-2-local-build

Conversation

@catatafishen

Copy link
Copy Markdown
Owner

Fixes #968.

Problem

A local Gradle compile of plugin-core (:plugin-core:compileKotlin) fails with ~108 unresolved-reference errors when intellijPlatform.localPath points at an IU 2026.2 (build 262+) installation:

  • com.intellij.ui.jcef.* / org.cef.* (JCEF) — JBCefBrowser, JBCefJSQuery, JBCefApp, etc.
  • com.intellij.dvcs.repo.Repository / AbstractRepositoryManager (supertypes of Git4Idea's GitRepository)
  • com.intellij.vcs.log.impl.VcsProjectLog

Reproduced locally against an actual IU 2026.2.0.1 (262.8665.337) install.

Root cause

Build 262 (2026.2) reorganized the platform layout further:

  • JCEF moved from the auto-included boot classpath into a separately class-loaded bundled plugin (com.intellij.modules.jcef).
  • intellij.platform.vcs.dvcs, intellij.platform.vcs.dvcs.impl, and intellij.platform.vcs.log.impl are productModuleV2 jars in lib/ that IntelliJ Platform Gradle Plugin 2.18.1 no longer puts on the compile classpath automatically.
  • lib/intellij.libraries.lucene.common.jar (added explicitly for the 2026.1 move) no longer exists at all in 2026.2 — the previously-unconditional bundledLibrary(...) call for it would itself break every local 2026.2 build.

Fix

In plugin-core/build.gradle.kts and plugin-experimental/build.gradle.kts:

  1. Explicitly declare bundledPlugin("com.intellij.modules.jcef") and bundledModule("intellij.platform.vcs.dvcs") / ...vcs.dvcs.impl / ...vcs.log.impl so these resolve on the compile classpath. These calls are no-ops on 2025.3/2026.1 where the classes were already auto-included.
  2. Guard the lucene.common.jar bundledLibrary call to only fire when the jar exists on disk (mirrors the existing guard used for the test-only compileOnly(files(jar)) a few lines below).
  3. Treat a blank intellijPlatform.localPath (e.g. -PintellijPlatform.localPath=) as unset rather than passing an empty string to local(), so it can be used to opt out of a broken local IDE per-invocation without editing ~/.gradle/gradle.properties.

Verification

  • ./gradlew :plugin-core:compileKotlin against the local IU 2026.2.0.1 install: previously ~108 errors → now BUILD SUCCESSFUL.
  • ./gradlew :plugin-core:compileTestJava :plugin-core:compileTestKotlin :plugin-experimental:compileKotlin :plugin-experimental:compileTestJava :mcp-server:compileJava: BUILD SUCCESSFUL.
  • Confirmed (via git stash) that :integration-tests:compileTestJava fails against the same 2026.2 local install both before and after this change, due to an unrelated JVM-toolchain metadata mismatch (project declares Java 21, 2026.2 requires 25) — a distinct, pre-existing problem not touched by this PR.
  • CI is unaffected: it downloads intellijPlatformVersion=2026.1.3 (no localPath), and the added bundledPlugin/bundledModule calls are no-ops there since those classes were already auto-included.

Out of scope (from the issue's suggested work list)

  • Bumping the IntelliJ Platform Gradle Plugin: 2.18.1 is still the latest published release — there is no newer version to bump to.
  • Adding a 262 CI compatibility job: blocked by the separate JVM 21 vs 25 toolchain issue in integration-tests noted above; tracking that as follow-up work rather than bundling an unrelated fix into this PR.

Fixes #968. Local compiles against a `intellijPlatform.localPath` IDE
install broke against IU 2026.2 (build 262) with ~108 unresolved
references (JCEF, dvcs/vcs-log classes):

- JCEF (`com.intellij.ui.jcef.*`, `org.cef.*`) moved out of the
  auto-included boot classpath into a separately class-loaded bundled
  plugin (`com.intellij.modules.jcef`) as of build 262. Declare it
  explicitly via `bundledPlugin`.
- `com.intellij.dvcs.repo.Repository` / `AbstractRepositoryManager`
  (supertypes of `GitRepository`) and `com.intellij.vcs.log.impl.VcsProjectLog`
  live in product modules (`intellij.platform.vcs.dvcs`,
  `intellij.platform.vcs.dvcs.impl`, `intellij.platform.vcs.log.impl`)
  that IU 262 stopped auto-including on the compile classpath. Request
  them explicitly via `bundledModule` (a no-op on older versions where
  they were already auto-included).
- `intellij.libraries.lucene.common.jar` no longer exists at all in IU
  262's `lib/` — the unconditional `bundledLibrary(...)` call for it
  now only fires when the jar is present on disk.
- A blank `intellijPlatform.localPath` (e.g.
  `-PintellijPlatform.localPath=` passed to opt out of a broken local
  IDE without editing `~/.gradle/gradle.properties`) is now treated as
  unset instead of being passed to `local()` as a literal empty path.

Verified by compiling `plugin-core` and `plugin-experimental` against
a local IU 2026.2.0.1 (262.8665.337) install — previously ~108 errors,
now BUILD SUCCESSFUL. CI (which downloads 2026.1.3, unaffected by this
bug) is unchanged by these edits since the added `bundledPlugin`/
`bundledModule` calls are no-ops there.

Not addressed here (out of scope / separate problems):
- Bumping the IntelliJ Platform Gradle Plugin: 2.18.1 is still the
  latest release: no newer version exists that changes this behavior.
- Adding a 262 CI compatibility job: `integration-tests` fails to even
  resolve dependencies against a 2026.2 `local()` install due to an
  unrelated JVM-toolchain metadata mismatch (21 vs 25) introduced by
  2026.2 requiring Java 25 — a distinct issue from the compile-classpath
  breakage this issue reports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 12, 2026 16:51
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Resolves local Gradle compilation failures against IntelliJ IDEA IU 2026.2 (build 262+) by making the IntelliJ Platform Gradle configuration explicitly opt into newly split platform components (JCEF + VCS product modules) and by hardening local-path handling around removed Lucene artifacts.

Changes:

  • Treat -PintellijPlatform.localPath= (blank) as “unset” so builds fall back to the downloaded IDE instead of attempting local("").
  • Add explicit IntelliJ bundled dependencies in plugin-core for 2026.2’s split-out JCEF plugin and VCS-related product modules.
  • Guard bundledLibrary("lib/intellij.libraries.lucene.common.jar") so local 2026.2 installs (where the jar is removed) don’t break dependency resolution.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
plugin-core/build.gradle.kts Adds explicit JCEF + VCS module dependencies for 2026.2 local builds, guards Lucene bundled library, and normalizes blank localPath.
plugin-experimental/build.gradle.kts Normalizes blank localPath and guards Lucene bundled library lookup for local installs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

// A blank value (e.g. `-PintellijPlatform.localPath=` passed on the command line to opt
// out of a broken local IDE without editing ~/.gradle/gradle.properties) must be treated
// as unset, not as a literal empty path passed to local().
val localPath = providers.gradleProperty("intellijPlatform.localPath").orNull?.takeIf { it.isNotBlank() }
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local dev build broken against IntelliJ IDEA 2026.2: JCEF and dvcs classes unresolved

2 participants