-
Notifications
You must be signed in to change notification settings - Fork 26
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
#911 support intellij 2024.2 by updating gradle version #1053
base: intellij-2024.2-support
Are you sure you want to change the base?
Changes from all commits
483b5d9
19c8088
d0a87d9
3ad17db
111d7a4
e518ace
7385bb6
843b27a
ea0cbf0
717e0e1
8f91cb6
3f83037
8d1e9de
58c7ff6
39b2e89
b1cb75c
f595ab6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
import org.jetbrains.intellij.platform.gradle.TestFrameworkType | ||
plugins { | ||
id 'java' | ||
id 'org.jetbrains.intellij' version '1.17.3' | ||
id 'org.jetbrains.kotlin.jvm' version '1.7.22' | ||
id 'org.jetbrains.intellij.platform' version '2.1.0' | ||
id 'org.jetbrains.kotlin.jvm' version '2.0.20' | ||
} | ||
|
||
group 'io.openliberty.tools' | ||
version '24.0.9' | ||
|
||
sourceCompatibility = 17 | ||
targetCompatibility = 17 | ||
|
||
def remoteRobotVersion = "0.11.18" | ||
def remoteRobotVersion = "0.11.23" | ||
// To switch to nightly version, append "@nightly" to the version number (i.e. 0.4.1-20240828-013108@nightly) | ||
def lsp4ijVersion = '0.7.0' | ||
|
||
allprojects { | ||
sourceCompatibility = javaVersion | ||
targetCompatibility = javaVersion | ||
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
|
@@ -43,7 +47,9 @@ repositories { | |
maven { | ||
url = "https://cache-redirector.jetbrains.com/download-pgp-verifier" | ||
} | ||
|
||
intellijPlatform { | ||
defaultRepositories() | ||
} | ||
mavenLocal() // TODO remove once Liberty LS is publicly available | ||
} | ||
|
||
|
@@ -60,7 +66,7 @@ configurations { | |
// Ensures that the JVM target is set to 17 for all Kotlin compilation tasks, including both main and test sources. | ||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
jvmTarget = javaVersion | ||
} | ||
} | ||
} | ||
|
@@ -97,9 +103,7 @@ dependencies { | |
testImplementation 'com.intellij.remoterobot:remote-robot:' + remoteRobotVersion | ||
testImplementation 'com.intellij.remoterobot:remote-fixtures:' + remoteRobotVersion | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2' | ||
testImplementation('com.jetbrains.intellij.maven:maven-test-framework:241.15989.150') { | ||
transitive = false | ||
} | ||
|
||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.9.2' | ||
|
||
|
@@ -129,29 +133,47 @@ dependencies { | |
implementation files(new File(buildDir, 'server')) { | ||
builtBy 'copyDeps' | ||
} | ||
} | ||
intellijPlatform { | ||
// For a full list of IntelliJ IDEA releases please see https://www.jetbrains.com/intellij-repository/releases | ||
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion")) | ||
bundledPlugins providers.gradleProperty("platformBundledPlugins").orElse("").get().split(',').toList() | ||
|
||
def lsp4ij = providers.gradleProperty('useLocal') && providers.gradleProperty('useLocal') == 'true' ? | ||
file("../lsp4ij/build/distributions/LSP4IJ/") : | ||
'com.redhat.devtools.lsp4ij:' + lsp4ijVersion | ||
plugins lsp4ij | ||
pluginVerifier() | ||
zipSigner() | ||
instrumentationTools() | ||
Comment on lines
+145
to
+147
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain why these lines needed to be added? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. InstrumentationTools() Why Do You Need It? When you develop a plugin for an IntelliJ-based IDE, new versions of the IDE might introduce changes that could potentially break the functionality of your plugin. The Plugin Verifier ensures your plugin works with the version(s) of the IDE you intend it to support. It checks for compatibility issues and reports any problems, such as deprecated API usage, missing features, or unsupported changes in the IDE. Without verifying, your plugin might break when users upgrade to newer versions of the IDE, leading to crashes or broken functionality for them.https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#target-platforms I am not sure whether we need zipSigner(). In simple terms, Plugin Signing ensures that the plugin you install on your IDE has not been tampered with and comes from the original developer who created it. |
||
|
||
testFramework TestFrameworkType.Platform.INSTANCE | ||
testFramework TestFrameworkType.Plugin.Java.INSTANCE | ||
testFramework TestFrameworkType.Plugin.Maven.INSTANCE | ||
TrevCraw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
task copyDeps(type: Copy) { | ||
from configurations.lsp | ||
into new File(buildDir, 'server/server') | ||
rename '^(.*)(-[0-9]+[.[0-9]+]+(-SNAPSHOT)?)(.*)$', '$1$4' | ||
} | ||
|
||
runIde { | ||
jvmArgs '--add-exports', 'java.base/jdk.internal.vm=ALL-UNNAMED' | ||
jvmArgumentProviders.add({ | ||
[ | ||
"--add-exports", | ||
"java.base/jdk.internal.vm=ALL-UNNAMED", | ||
] | ||
} as CommandLineArgumentProvider) | ||
} | ||
|
||
intellij { | ||
// For a full list of IntelliJ IDEA releases please see https://www.jetbrains.com/intellij-repository/releases | ||
version = '2024.1.6' | ||
test { | ||
useJUnitPlatform() | ||
|
||
def lsp4ij = project.hasProperty('useLocal') && project.property('useLocal') == 'true' ? | ||
file("../lsp4ij/build/distributions/LSP4IJ/") : | ||
'com.redhat.devtools.lsp4ij:' + lsp4ijVersion | ||
plugins = ['java', 'maven', 'gradle-java', 'properties', 'terminal', 'org.jetbrains.idea.maven', 'com.intellij.gradle', lsp4ij] | ||
updateSinceUntilBuild = false | ||
testLogging { | ||
showStandardStreams = true | ||
exceptionFormat = 'full' | ||
} | ||
} | ||
|
||
downloadRobotServerPlugin { | ||
version.set(remoteRobotVersion) | ||
} | ||
|
@@ -168,27 +190,15 @@ runIdeForUiTests { | |
systemProperty "apple.laf.useScreenMenuBar", "false" | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
|
||
testLogging { | ||
showStandardStreams = true | ||
exceptionFormat = 'full' | ||
} | ||
} | ||
|
||
tasks { | ||
// Disabling buildSearchableOptions, which runs as part of the buildPlugin task. | ||
// this is to buildSearchableOptions to workaround the "Only one instance of IDEA can be run at a time" problem. | ||
// Per documentation: https://plugins.jetbrains.com/docs/intellij/ide-development-instance.html#the-development-instance-sandbox-directory | ||
buildSearchableOptions { | ||
enabled = false | ||
} | ||
} | ||
|
||
patchPluginXml { | ||
changeNotes = """ | ||
<h2> 24.0.9 </h2> | ||
intellijPlatform { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here in this doc it's explained https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#setting-up-intellij-platform to add intellijPlatform in different places as per new updation. |
||
buildSearchableOptions = false | ||
pluginConfiguration { | ||
ideaVersion { | ||
sinceBuild = providers.gradleProperty("pluginSinceBuild") | ||
untilBuild = providers.gradleProperty("pluginUntilBuild") | ||
} | ||
changeNotes = """ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did the change notes need to be moved from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change was suggested by jetbrains team to move the patchPluginXml.changeNotes to intellijPlatform.pluginConfiguration.changeNotes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. We will need to confirm that this still works correctly when the plugin is uploaded to the marketplace. Can you please open an issue to upload an early version of the plugin to a private repo/stream in the JetBrains marketplace to check that the plugin info and change notes are displayed properly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I have created the issue for analysing this part here : #1112 |
||
<h2> 24.0.9 </h2> | ||
<p>Version 24.0.9 of Liberty Tools for IntelliJ IDEA contains enhancements and fixes. Version 24.0.9 requires IntelliJ IDEA version 2024.1.* ONLY and a minimum of Java 17.</p> | ||
Notable changes: | ||
<ul> | ||
|
@@ -326,5 +336,6 @@ patchPluginXml { | |
<li> First preview release | ||
</ul> | ||
""" | ||
version project.version | ||
version project.version | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
useLocal=false | ||
pluginSinceBuild=241 | ||
pluginUntilBuild=242.* | ||
|
||
javaVersion=17 | ||
javaTargetVersion=17 | ||
|
||
# Target IntelliJ Community by default | ||
platformType=IC | ||
platformVersion=2024.1.7 | ||
|
||
# Example: platformBundledPlugins = com.intellij.java | ||
platformBundledPlugins=com.intellij.java, org.jetbrains.idea.maven, com.intellij.gradle, org.jetbrains.plugins.terminal, com.intellij.properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this being removed? This will eventually be updated later, but should be left alone for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this dependency as jetbrains have introduced new TEST Framework which will automatically include this dependency based on intellij version in our project. This was suggested by jetbrains team here
https://jetbrains-platform.slack.com/archives/C5U8BM1MK/p1730297530842639?thread_ts=1730105939.390899&cid=C5U8BM1MK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we have confirmed that we can run the unit tests with this dependency removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, @TrevCraw,
Instead of adding maven-test-framework directly, IntelliJ 2024.2 introduced a way to add this line: testFramework TestFrameworkType.Plugin.Maven.INSTANCE within the intellijPlatform setup under the dependencies tag. This approach ensures that the dependency is downloaded in our project, and the version is determined by the IntelliJ platform version specified.
However, even with this adjustment, unit tests do not work in IntelliJ 2024.2. That said, making this change has been verified to fully support unit tests in IntelliJ 2024.1.
These are the dependencies used in the project, and when removing the direct dependency and instead adding the framework as suggested by JetBrains, maven-test-framework is downloaded correctly.
Thanks,