@@ -39,14 +39,32 @@ version = "2.6.1"
39
39
40
40
repositories {
41
41
mavenCentral()
42
+ ivy {
43
+ url = uri(" https://github.com/PowerShell/PSScriptAnalyzer/releases/download/" )
44
+ patternLayout {
45
+ artifact(" [revision]/[module].[revision].[ext]" )
46
+ }
47
+ content {
48
+ includeGroup(" PSScriptAnalyzer" )
49
+ }
50
+ metadataSources {
51
+ artifact()
52
+ }
53
+ }
42
54
}
43
55
56
+ val psScriptAnalyzer: Configuration by configurations.creating
57
+
44
58
dependencies {
45
59
implementation(libs.bundles.junixsocket)
46
60
47
61
implementation(libs.lsp4j)
48
62
testImplementation(" org.jetbrains.kotlin:kotlin-test-junit" )
49
63
testImplementation(libs.junit)
64
+
65
+ libs.psScriptAnalyzer.get().apply {
66
+ psScriptAnalyzer(group = this .group!! , name = this .name, version = this .version, ext = " nupkg" )
67
+ }
50
68
}
51
69
52
70
configurations {
@@ -158,29 +176,21 @@ tasks {
158
176
159
177
val downloads = layout.buildDirectory.get().dir(" download" )
160
178
161
- val psScriptAnalyzerVersion: String by project
162
- val psScriptAnalyzerSha256Hash: String by project
163
- val psScriptAnalyzerFileName = " PSScriptAnalyzer.$psScriptAnalyzerVersion .nupkg"
164
- val psScriptAnalyzerOutFile = downloads.file(psScriptAnalyzerFileName)
165
-
166
179
val psesVersion: String by project
167
180
val psesSha256Hash: String by project
168
181
169
- val getPsScriptAnalyzer = getDependencyTask(
170
- " PSScriptAnalyzer" ,
171
- psScriptAnalyzerVersion,
172
- psScriptAnalyzerSha256Hash,
173
- URI (
174
- " https://github.com/PowerShell/PSScriptAnalyzer/releases/download/" +
175
- " $psScriptAnalyzerVersion /$psScriptAnalyzerFileName "
176
- ),
177
- psScriptAnalyzerOutFile
178
- ) {
179
- // NuGet stuff:
180
- exclude(" _manifest/**" , " _rels/**" , " package/**" , " [Content_Types].xml" , " *.nuspec" )
182
+ fun PrepareSandboxTask.unpackPsScriptAnalyzer (outDir : String ) {
183
+ dependsOn(psScriptAnalyzer)
184
+
185
+ from(zipTree(psScriptAnalyzer.singleFile)) {
186
+ into(" $outDir /PSScriptAnalyzer" )
181
187
182
- // Compatibility profiles, see https://github.com/PowerShell/PSScriptAnalyzer/issues/1148
183
- exclude(" compatibility_profiles/**" )
188
+ // NuGet stuff:
189
+ exclude(" _manifest/**" , " _rels/**" , " package/**" , " [Content_Types].xml" , " *.nuspec" )
190
+
191
+ // Compatibility profiles, see https://github.com/PowerShell/PSScriptAnalyzer/issues/1148
192
+ exclude(" compatibility_profiles/**" )
193
+ }
184
194
}
185
195
186
196
val getPowerShellEditorServices = getDependencyTask(
@@ -200,11 +210,14 @@ tasks {
200
210
}
201
211
202
212
val getAllDependencies by registering {
203
- dependsOn(getPsScriptAnalyzer, getPowerShellEditorServices)
213
+ dependsOn(getPowerShellEditorServices)
204
214
}
205
215
206
216
withType<PrepareSandboxTask > {
207
217
dependsOn(getAllDependencies)
218
+ val outDir = " ${intellij.pluginName.get()} /lib/LanguageHost/modules"
219
+ unpackPsScriptAnalyzer(outDir)
220
+
208
221
from(" ${project.rootDir} /language_host" ) {
209
222
into(" ${intellij.pluginName.get()} /lib/" )
210
223
}
0 commit comments