@@ -3,6 +3,9 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
3
3
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
4
4
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
5
5
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
6
+ import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.*
7
+ import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.VerificationReportsFormats.MARKDOWN
8
+ import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.VerificationReportsFormats.PLAIN
6
9
7
10
plugins {
8
11
id(" idea" )
@@ -34,7 +37,7 @@ repositories {
34
37
35
38
dependencies {
36
39
intellijPlatform {
37
- create( IntelliJPlatformType . IntellijIdeaCommunity , ideaVersion)
40
+ intellijIdeaCommunity( ideaVersion)
38
41
39
42
// Bundled Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
40
43
bundledPlugins(providers.gradleProperty(" platformBundledPlugins" ).map { it.split(' ,' ) })
@@ -47,8 +50,6 @@ dependencies {
47
50
48
51
pluginVerifier()
49
52
50
- instrumentationTools()
51
-
52
53
testFramework(TestFrameworkType .Platform )
53
54
}
54
55
@@ -68,7 +69,6 @@ dependencies {
68
69
implementation(libs.jjwt.impl)
69
70
implementation(libs.jjwt.jackson)
70
71
implementation(libs.converter.jackson)
71
- implementation(libs.annotations) // to build against platform <= 2023.2
72
72
73
73
// for unit tests
74
74
testImplementation(libs.junit)
@@ -106,8 +106,10 @@ intellijPlatform {
106
106
}
107
107
108
108
pluginVerification {
109
+ failureLevel = listOf (INVALID_PLUGIN , COMPATIBILITY_PROBLEMS , MISSING_DEPENDENCIES )
110
+ verificationReportsFormats = listOf (MARKDOWN , PLAIN )
109
111
ides {
110
- ide( IntelliJPlatformType . IntellijIdeaCommunity , ideaVersion )
112
+ recommended( )
111
113
}
112
114
freeArgs = listOf (
113
115
" -mute" ,
@@ -121,16 +123,8 @@ tasks {
121
123
gradleVersion = providers.gradleProperty(" gradleVersion" ).get()
122
124
}
123
125
124
- fun supportsEnhancedClassRedefinition (): Boolean {
125
- val platformVersion = findProperty(" platformVersion" ).toString().toFloatOrNull()
126
- return platformVersion != null
127
- && platformVersion >= 2024.1
128
- }
129
-
130
126
runIde {
131
- if (supportsEnhancedClassRedefinition()) {
132
- jvmArgs(" -XX:+AllowEnhancedClassRedefinition" , " -XX:HotswapAgent=fatjar" )
133
- }
127
+ jvmArgs(" -XX:+AllowEnhancedClassRedefinition" , " -XX:HotswapAgent=fatjar" )
134
128
systemProperty(" com.redhat.devtools.intellij.telemetry.mode" , " debug" )
135
129
findProperty(" tools.dl.path" )?.let { systemProperty(" tools.dl.path" , it) }
136
130
// systemProperty("jboss.sandbox.api.endpoint", "http://localhost:3000") // enable when running sandbox locally, see below
@@ -194,19 +188,20 @@ tasks {
194
188
sourceSets {
195
189
create(" it" ) {
196
190
description = " integrationTest"
191
+ java.srcDir(" src/it/java" )
192
+ resources.srcDir(" src/it/resources" )
197
193
compileClasspath + = sourceSets.main.get().compileClasspath + sourceSets.test.get().compileClasspath
198
- runtimeClasspath + = output + compileClasspath
194
+ runtimeClasspath + = output + compileClasspath + sourceSets.test.get().runtimeClasspath
199
195
}
200
196
}
201
197
202
- configurations.all {
203
- exclude(group = " org.slf4j" , module = " slf4j-api" )
204
- exclude(group = " bundledPlugin" , module = " Docker" ) // suppress multiple SLF4J providers
198
+ configurations {
199
+ runtimeClasspath {
200
+ exclude(group = " org.slf4j" , module = " slf4j-api" )
201
+ exclude(group = " bundledPlugin" , module = " Docker" ) // suppress multiple SLF4J providers
202
+ }
205
203
}
206
204
207
- configurations[" itRuntimeOnly" ].extendsFrom(configurations.testRuntimeOnly.get())
208
- configurations[" itImplementation" ].extendsFrom(configurations.testImplementation.get())
209
-
210
205
val integrationTest by intellijPlatformTesting.testIde.registering {
211
206
task {
212
207
systemProperty(" com.redhat.devtools.intellij.telemetry.mode" , " disabled" )
@@ -222,24 +217,14 @@ val integrationTest by intellijPlatformTesting.testIde.registering {
222
217
showStandardStreams = false
223
218
}
224
219
jvmArgs(" -Djava.awt.headless=true" )
225
- useJUnitPlatform {
226
- includeEngines(" junit-vintage" )
227
- excludeEngines(" junit-jupiter" )
228
- }
229
220
shouldRunAfter(tasks[" test" ])
230
221
}
231
222
232
223
dependencies {
233
- testRuntimeOnly(libs.junit.vintage.engine)
234
- testImplementation(libs.junit.platform.launcher)
235
- testImplementation(libs.junit.platform.suite)
236
- testImplementation(libs.junit.jupiter)
237
- testImplementation(libs.junit.jupiter.api)
238
- testImplementation(libs.junit.jupiter.engine)
239
224
testImplementation(devtoolsCommonForTests)
240
- testImplementation(libs.devtools.common.ui.test)
241
225
testImplementation(libs.awaitility)
242
226
}
227
+
243
228
}
244
229
245
230
val integrationUITest by intellijPlatformTesting.testIde.registering {
@@ -267,10 +252,14 @@ val integrationUITest by intellijPlatformTesting.testIde.registering {
267
252
shouldRunAfter(tasks[" test" ])
268
253
}
269
254
270
- plugins {
271
- robotServerPlugin()
255
+ dependencies {
256
+ testRuntimeOnly(libs.junit.jupiter.engine)
257
+ testImplementation(libs.junit.platform.suite)
258
+ testImplementation(libs.junit.platform.launcher)
259
+ testImplementation(libs.junit.jupiter.api)
260
+ testImplementation(libs.devtools.common.ui.test)
272
261
}
273
-
262
+ /*
274
263
dependencies {
275
264
testImplementation(libs.junit.platform.launcher)
276
265
testImplementation(libs.junit.platform.suite)
@@ -281,6 +270,8 @@ val integrationUITest by intellijPlatformTesting.testIde.registering {
281
270
testImplementation(libs.devtools.common.ui.test)
282
271
testImplementation(libs.awaitility)
283
272
}
273
+ */
274
+
284
275
}
285
276
286
277
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-tasks.html#runIdeForUiTests
@@ -293,7 +284,11 @@ val runIdeForUiTests by intellijPlatformTesting.runIde.registering {
293
284
" -Djb.consents.confirmation.enabled=false" ,
294
285
)
295
286
}
287
+
288
+ systemProperty(" robot-server.port" , System .getProperty(" robot-server.port" ))
289
+ systemProperty(" com.redhat.devtools.intellij.telemetry.mode" , " disabled" )
296
290
}
291
+
297
292
plugins {
298
293
robotServerPlugin()
299
294
}
0 commit comments