@@ -9,16 +9,26 @@ plugins {
9
9
id(" toolkit-kotlin-conventions" )
10
10
id(" toolkit-intellij-plugin" )
11
11
12
- id(" org.jetbrains.intellij.platform.base " )
12
+ id(" org.jetbrains.intellij.platform" )
13
13
}
14
14
15
15
val ideProfile = IdeVersions .ideProfile(project)
16
+ val testPlugins by configurations.registering
16
17
17
- // Add our source sets per IDE profile version (i.e. src-211)
18
18
sourceSets {
19
19
test {
20
- java.srcDirs(findFolders(project, " tst" , ideProfile))
21
- resources.srcDirs(findFolders(project, " tst-resources" , ideProfile))
20
+ java.setSrcDirs(findFolders(project, " tst-prep" , ideProfile))
21
+ resources.setSrcDirs(findFolders(project, " tst-resources" , ideProfile))
22
+ }
23
+ }
24
+
25
+ val uiTestSource = sourceSets.create(" uiTest" ) {
26
+ java.setSrcDirs(findFolders(project, " tst" , ideProfile))
27
+ }
28
+
29
+ idea {
30
+ module {
31
+ testSources.from(uiTestSource.allSource.srcDirs)
22
32
}
23
33
}
24
34
@@ -27,35 +37,57 @@ intellijPlatform {
27
37
instrumentCode = false
28
38
}
29
39
30
- tasks.initializeIntellijPlatformPlugin {
31
- enabled = false
32
- }
40
+ val uiTestImplementation by configurations.getting
33
41
34
- tasks.verifyPluginProjectConfiguration {
35
- runtimeDirectory.set(null as File ? )
36
- enabled = false
42
+ configurations.getByName(uiTestSource.compileClasspathConfigurationName) {
43
+ extendsFrom(uiTestImplementation)
37
44
}
38
45
39
- val testPlugins by configurations.registering
46
+ configurations.getByName(uiTestSource.runtimeClasspathConfigurationName) {
47
+ extendsFrom(uiTestImplementation)
48
+ }
40
49
41
50
dependencies {
42
51
// should really be set by the BOM, but too much work to figure out right now
43
- testImplementation(" org.kodein.di:kodein-di-jvm:7.20.2" )
52
+ uiTestImplementation(" org.kodein.di:kodein-di-jvm:7.20.2" )
53
+ uiTestImplementation(platform(libs.junit5.bom))
54
+ uiTestImplementation(libs.junit5.jupiter)
55
+
44
56
intellijPlatform {
45
- // shouldn't be needed? but IsolationException
46
57
val version = ideProfile.community.sdkVersion
47
58
intellijIdeaCommunity(version, ! version.contains(" SNAPSHOT" ))
48
- testFramework(TestFrameworkType .Starter )
59
+
60
+ localPlugin(project(" :plugin-core" ))
61
+ testImplementation(project(" :plugin-core:core" ))
62
+ testImplementation(project(" :plugin-core:jetbrains-community" ))
63
+ testImplementation(testFixtures(project(" :plugin-core:jetbrains-community" )))
64
+
65
+ testFramework(TestFrameworkType .Bundled )
66
+ testFramework(TestFrameworkType .JUnit5 )
67
+
68
+ testFramework(TestFrameworkType .Starter , configurationName = uiTestImplementation.name)
49
69
}
50
70
51
71
testPlugins(project(" :plugin-amazonq" , " pluginZip" ))
52
72
testPlugins(project(" :plugin-core" , " pluginZip" ))
53
73
}
54
74
55
75
tasks.test {
56
- dependsOn(testPlugins)
76
+ enabled = false
77
+ }
57
78
58
- useJUnitPlatform()
79
+ val prepareAmazonQTest by intellijPlatformTesting.testIde.registering {
80
+ task {
81
+ useJUnitPlatform()
82
+ }
83
+ }
84
+
85
+ tasks.register<Test >(" uiTest" ) {
86
+ testClassesDirs = uiTestSource.output.classesDirs
87
+ classpath = uiTestSource.runtimeClasspath
88
+
89
+ dependsOn(prepareAmazonQTest)
90
+ dependsOn(testPlugins)
59
91
60
92
systemProperty(" ui.test.plugins" , testPlugins.get().asPath)
61
93
systemProperty(" org.gradle.project.ideProfileName" , ideProfile.name)
0 commit comments