Skip to content

Commit 8e7b306

Browse files
authored
Merge pull request #3763 from sh41/jps-plugin-fix
Fix JPS plugin & refactor
2 parents 042b07c + e487535 commit 8e7b306

File tree

124 files changed

+3376
-2337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+3376
-2337
lines changed

.github/workflows/shared-test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
fail-fast: false
4242
matrix:
4343
# Stay with windows-2022 until https://github.com/erlef/setup-beam/commit/b94e7d372a9ef22d376b75a9374a7adeb0e2ea94 is released.
44-
os: [ubuntu-22.04, windows-2022]
45-
idea-version: ['2025.3.2', 'LATEST-EAP-SNAPSHOT']
44+
os: [ ubuntu-22.04, windows-2022 ]
45+
idea-version: [ '2025.3.2', 'LATEST-EAP-SNAPSHOT' ]
4646

4747
steps:
4848
- name: Checkout
@@ -135,7 +135,11 @@ jobs:
135135
strategy:
136136
fail-fast: false
137137
matrix:
138-
ide-version: ['ideaIU:253.30387.90', 'rubymine:2025.3.2']
138+
include:
139+
- ide-version: 'ideaIU:253.30387.90'
140+
external-prefixes: ''
141+
- ide-version: 'rubymine:2025.3.2'
142+
external-prefixes: 'org.jetbrains.jps'
139143

140144
steps:
141145
- name: Download Plugin Artifact
@@ -152,6 +156,7 @@ jobs:
152156
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153157
with:
154158
ide-versions: ${{ matrix.ide-version }}
159+
external-prefixes: ${{ matrix.external-prefixes }}
155160

156161
- name: Print Verification Output
157162
id: print-verification-output

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ libs/
3333
CLAUDE.md
3434
/.claude
3535
/.ai
36+
/allure-results

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The build system automatically detects your platform:
109109
**getQuoterDeps fails in PowerShell (erl not found):**
110110
- Run the task from Git Bash so `/usr/bin/sh` sees a full PATH.
111111
- Example:
112-
- `cd /c/Users/steve/IdeaProjects/intellij-elixir`
112+
- `cd /c/Users/user/IdeaProjects/intellij-elixir`
113113
- `./gradlew.bat getQuoterDeps --rerun-tasks --no-build-cache --no-configuration-cache`
114114
- If needed, add Erlang to Git Bash PATH, e.g. `export PATH="/c/Program Files/erl-24.3.4.6/bin:$PATH"`.
115115

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ The plugin supports running Elixir, Mix, and IEx commands within WSL. This inclu
483483

484484
* **New Project Wizard**: SDK selection is based on the location of the currently open project, not the new project. To select a WSL based SDK during the New Project Wizard, open any WSL project or directory in the IDE first.
485485
* **SDKs and Project must all be on the same WSL Distribution**: You cannot use a WSL based SDK with a non-WSL project, and vice versa. You can use the `/mnt/c` drive to access Windows files from WSL, but the performance is terrible.
486+
* **Build system (Ctrl+F9)**: The IDE build system only works when the **Project SDK** is set to a **JDK 21+** in the same WSL distribution, and all **Module SDKs** are set to the correct **Elixir SDK**.
486487
* **Performance**: Running the IDE in Windows with a WSL project is slower than running the IDE directly in the WSL instance. This is a limitation of the IDE, not specific to the Elixir plugin.
487488

488489
### Module Settings

build.gradle.kts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,17 @@ allprojects {
144144
showStandardStreams = false
145145
showFailedStandardStreams = true
146146
}
147+
148+
tasks.withType<Test>().configureEach {
149+
inputs.dir(rootProject.layout.projectDirectory.dir("testData"))
150+
.withPropertyName("testData")
151+
.withPathSensitivity(PathSensitivity.RELATIVE)
152+
}
147153
}
148154

149155
// --- Subprojects (JPS) ---
150156
subprojects {
151-
apply(plugin = "org.jetbrains.intellij.platform.module")
157+
apply(plugin = "org.jetbrains.intellij.platform.base")
152158

153159
repositories {
154160
intellijPlatform { defaultRepositories() }
@@ -157,21 +163,14 @@ subprojects {
157163
dependencies {
158164
intellijPlatform {
159165
create(providers.gradleProperty("platformType"), providers.provider { actualPlatformVersion })
160-
bundledPlugins("com.intellij.java")
161-
testFramework(TestFrameworkType.Platform)
162166
}
163-
// JPS Builder tests extend UsefulTestCase (JUnit 3/4 style) and need explicit JUnit 4 on classpath
164-
testImplementation(libJunit)
165167
}
166168

167169
sourceSets {
168170
main {
169171
java.srcDirs("src")
170172
resources.srcDirs("resources")
171173
}
172-
test {
173-
java.srcDir("tests")
174-
}
175174
}
176175
}
177176

@@ -266,6 +265,9 @@ intellijPlatform {
266265
sinceBuild = providers.gradleProperty("pluginVerifierVersion").get()
267266
}
268267
}
268+
// This allows us to verify small IDEs without errors about the JPS plugin.
269+
// It's not ideal, but there doesn't seem to be any other way to deal with it right now.
270+
externalPrefixes.add("org.jetbrains.jps")
269271
}
270272
sourceSets {
271273
val testUI: SourceSet by project.sourceSets
@@ -313,8 +315,8 @@ dependencies {
313315
testFramework(TestFrameworkType.JUnit5, configurationName = "testUIImplementation")
314316
}
315317

316-
implementation(project(":jps-builder"))
317318
implementation(project(":jps-shared"))
319+
runtimeOnly(project(":jps-builder"))
318320
implementation(files("lib/OtpErlang.jar"))
319321
implementation(libCommonsIo)
320322

gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,9 @@ org.gradle.configuration-cache=true
9292
org.gradle.caching=true
9393
org.gradle.parallel=true
9494
#org.gradle.daemon=false
95+
# - Kotlin stdlib dependency conflict The Kotlin Standard Library (stdlib) is automatically added by the Gradle Kotlin
96+
# plugin and may conflict with the version bundled in IntelliJ Platform. This can cause ClassNotFoundException or
97+
# version mismatch issues at runtime. Exclude the Kotlin stdlib dependency by setting
98+
# 'kotlin.stdlib.default.dependency=false' in gradle.properties.
99+
# See: https://jb.gg/intellij-platform-kotlin-stdlib
100+
kotlin.stdlib.default.dependency=false

jps-builder/build.gradle.kts

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
tasks.jar {
2-
archiveFileName.set("jps-builder.jar")
3-
}
1+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
42

5-
tasks.compileTestJava {
6-
dependsOn(":jps-shared:composedJar")
3+
base {
4+
archivesName.set("${rootProject.name}.${project.name}")
75
}
86

9-
tasks.compileJava {
10-
dependsOn(":jps-shared:composedJar")
7+
sourceSets {
8+
test {
9+
java.srcDir("tests")
10+
}
1111
}
1212

1313
java {
@@ -25,6 +25,17 @@ tasks.test {
2525

2626
val elixirPath: String by project
2727
val elixirVersion: String by project
28+
useJUnit()
29+
jvmArgs(
30+
"--add-opens=java.base/java.lang=ALL-UNNAMED",
31+
"--add-opens=java.desktop/java.awt=ALL-UNNAMED",
32+
"--add-opens=java.desktop/javax.swing=ALL-UNNAMED",
33+
"--add-opens=java.desktop/sun.awt=ALL-UNNAMED",
34+
"--add-opens=java.desktop/java.awt.event=ALL-UNNAMED",
35+
"--add-exports=java.base/sun.nio.ch=ALL-UNNAMED",
36+
"--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED",
37+
"--add-opens=java.base/java.nio=ALL-UNNAMED",
38+
)
2839

2940
environment("ELIXIR_LANG_ELIXIR_PATH", elixirPath)
3041
environment("ELIXIR_EBIN_DIRECTORY", "${elixirPath}/lib/elixir/ebin/")
@@ -33,6 +44,20 @@ tasks.test {
3344
include("**/*Test.class")
3445
}
3546

47+
configurations {
48+
named("testRuntimeClasspath") {
49+
extendsFrom(
50+
getByName("intellijPlatformTestClasspath"),
51+
getByName("intellijPlatformTestRuntimeFixClasspath")
52+
)
53+
}
54+
}
55+
3656
dependencies {
57+
intellijPlatform {
58+
testFramework(TestFrameworkType.Platform)
59+
bundledPlugins("com.intellij.java")
60+
}
3761
implementation(project(":jps-shared"))
62+
testImplementation(libs.junit)
3863
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
org.elixir_lang.jps.builder.Service
1+
org.elixir_lang.jps.builder.execution.Service
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.elixir_lang.jps.builder.model.SerializerExtension

0 commit comments

Comments
 (0)