Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1088 - Parameterize the java target and platform target values #1117

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
4 changes: 2 additions & 2 deletions .run/liberty-tools-intellij [runIde].run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="liberty-tools-intellij [runIde]" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="liberty-tools-intellij [runIdeLocally]" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
Expand All @@ -10,7 +10,7 @@
</option>
<option name="taskNames">
<list>
<option value="runIde" />
<option value="runIdeLocally" />
</list>
</option>
<option name="vmOptions" />
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This extension is built using the [gradle-intellij-plugin](https://github.com/Je

1. Clone this repository: `git clone git@github.com:OpenLiberty/liberty-tools-intellij.git`
2. Import this repository as a Gradle project in IntelliJ IDEA
3. Run `./gradlew runIde --stacktrace`. A new IntelliJ IDEA window will launch with the Liberty Tools plugin installed to it. You can connect the IntelliJ IDEA debugger to this process to debug the plugin.
3. Run `./gradlew runIdeLocally --stacktrace`. A new IntelliJ IDEA window will launch with the Liberty Tools plugin installed to it. You can connect the IntelliJ IDEA debugger to this process to debug the plugin.

OR

Expand All @@ -38,7 +38,7 @@ Liberty Tools for IntelliJ consumes the [Liberty Config Language Server](https:/

#### Debugging LemMinX Language Server
To debug the LemMinX Language Server in IntelliJ, complete the following steps.
1. Start Liberty Tools for IntelliJ by creating an IntelliJ debug configuration for the `./gradlew runIde command`.
1. Start Liberty Tools for IntelliJ by creating an IntelliJ debug configuration for the `./gradlew runIdeLocally command`.
2. Create a new debug configuration: _Remote JVM Debug_ --> specify _localhost_, port _1054_ and command line arguments `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:1054`
3. In `io.openliberty.tools.intellij.liberty.lsp.LibertyXmlServer.LibertyXmlServer()` replace the line ` params.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1054,quiet=y");` with `params.add("-agentlib:jdwp=transport=dt_socket,server=y,address=1054");`.
4. Start the debug configuration created in step 2. You can now step through the LemMinX LS code now with the IntelliJ debugger.
Expand Down
23 changes: 16 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
plugins {
id 'java'
id 'org.jetbrains.intellij.platform' version '2.1.0'
Expand Down Expand Up @@ -157,13 +158,19 @@ task copyDeps(type: Copy) {
rename '^(.*)(-[0-9]+[.[0-9]+]+(-SNAPSHOT)?)(.*)$', '$1$4'
}

runIde {
jvmArgumentProviders.add({
[
"--add-exports",
"java.base/jdk.internal.vm=ALL-UNNAMED",
]
} as CommandLineArgumentProvider)
intellijPlatformTesting.runIde {
runIdeLocally {
version = providers.gradleProperty("ideTargetVersion")
type = IntelliJPlatformType.IntellijIdeaCommunity
task {
jvmArgumentProviders.add({
[
"--add-exports",
"java.base/jdk.internal.vm=ALL-UNNAMED"
]
} as CommandLineArgumentProvider)
}
}
}

test {
Expand All @@ -177,6 +184,8 @@ test {

intellijPlatformTesting.runIde {
runIdeForUiTests {
version = providers.gradleProperty("ideTargetVersion")
type = IntelliJPlatformType.IntellijIdeaCommunity
task {
jvmArgumentProviders.add({
[
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ javaTargetVersion=17
# Target IntelliJ Community by default
platformType=IC
platformVersion=2024.1.7
ideTargetVersion=2024.2.4

# Example: platformBundledPlugins = com.intellij.java
platformBundledPlugins=com.intellij.java, org.jetbrains.idea.maven, com.intellij.gradle, org.jetbrains.plugins.terminal, com.intellij.properties
Loading