1
- import org.jetbrains.intellij.tasks.PrepareSandboxTask
1
+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
2
+ import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
2
3
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3
4
import java.security.MessageDigest
4
5
import java.util.zip.ZipFile
@@ -8,15 +9,14 @@ plugins {
8
9
alias(libs.plugins.changelog)
9
10
alias(libs.plugins.gradleJvmWrapper)
10
11
alias(libs.plugins.grammarkit)
11
- alias(libs.plugins.intellij )
12
+ alias(libs.plugins.intellijPlatform )
12
13
alias(libs.plugins.kotlin)
13
14
}
14
15
15
- intellij {
16
- type.set(" IC" )
17
- version.set(libs.versions.intellij)
18
- plugins.set(listOf (" org.intellij.intelliLang" , " terminal" ))
19
- pluginName.set(" PowerShell" )
16
+ intellijPlatform {
17
+ pluginConfiguration {
18
+ name = " PowerShell"
19
+ }
20
20
}
21
21
22
22
sourceSets {
@@ -34,6 +34,10 @@ group = "com.intellij.plugin"
34
34
version = " 2.6.1"
35
35
36
36
repositories {
37
+ intellijPlatform {
38
+ defaultRepositories()
39
+ }
40
+
37
41
mavenCentral()
38
42
ivy {
39
43
url = uri(" https://github.com/PowerShell/PSScriptAnalyzer/releases/download/" )
@@ -58,7 +62,15 @@ val psesSha256Hash: String by project
58
62
val powerShellEditorServices: Configuration by configurations.creating
59
63
60
64
dependencies {
65
+ intellijPlatform {
66
+ intellijIdeaCommunity(libs.versions.intellij)
67
+ bundledPlugins(" org.intellij.intelliLang" , " org.jetbrains.plugins.terminal" )
68
+ instrumentationTools()
69
+ testFramework(TestFrameworkType .Bundled )
70
+ }
71
+
61
72
implementation(libs.bundles.junixsocket)
73
+ compileOnly(libs.jetBrainsAnnotations)
62
74
63
75
implementation(libs.lsp4j)
64
76
testImplementation(" org.jetbrains.kotlin:kotlin-test-junit" )
@@ -154,11 +166,11 @@ tasks {
154
166
}
155
167
}
156
168
157
- fun PrepareSandboxTask.unpackPsScriptAnalyzer (outDir : String ) {
169
+ fun PrepareSandboxTask.unpackPsScriptAnalyzer (outDir : Provider < String > ) {
158
170
dependsOn(psScriptAnalyzer, verifyPsScriptAnalyzer)
159
171
160
172
from(zipTree(psScriptAnalyzer.singleFile)) {
161
- into(" $outDir /PSScriptAnalyzer" )
173
+ into(outDir.map { " $it /PSScriptAnalyzer" } )
162
174
163
175
// NuGet stuff:
164
176
exclude(" _manifest/**" , " _rels/**" , " package/**" , " [Content_Types].xml" , " *.nuspec" )
@@ -176,18 +188,18 @@ tasks {
176
188
}
177
189
}
178
190
179
- fun PrepareSandboxTask.unpackPowerShellEditorServices (outDir : String ) {
191
+ fun PrepareSandboxTask.unpackPowerShellEditorServices (outDir : Provider < String > ) {
180
192
dependsOn(powerShellEditorServices, verifyPowerShellEditorServices)
181
193
182
194
from(zipTree(powerShellEditorServices.singleFile)) {
183
- into(" $outDir / " )
195
+ into(outDir.map { " $it / " } )
184
196
// We only need this module and not anything else from the archive:
185
197
include(" PowerShellEditorServices/**" )
186
198
}
187
199
}
188
200
189
201
withType<PrepareSandboxTask > {
190
- val outDir = " ${intellij.pluginName.get()} /lib/LanguageHost/modules"
202
+ val outDir = intellijPlatform.pluginConfiguration.name.map { " $it /lib/LanguageHost/modules" }
191
203
unpackPsScriptAnalyzer(outDir)
192
204
unpackPowerShellEditorServices(outDir)
193
205
}
@@ -218,7 +230,7 @@ tasks {
218
230
219
231
runIde {
220
232
jvmArgs(" -Dide.plugins.snapshot.on.unload.fail=true" , " -XX:+UnlockDiagnosticVMOptions" )
221
- autoReloadPlugins.set( true )
233
+ autoReload = true
222
234
}
223
235
224
236
patchPluginXml {
0 commit comments