Skip to content

Commit db039c0

Browse files
authored
[PE] fix missing ai, yaml plugin dependencies (flutter#8201)
Fixes broken `com.google.tools.ij.aiplugin` and `org.jetbrains.plugins.yaml` plugin references by adding missing gradle dependencies. See inspection details here: https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html?from=DevkitPluginXmlInspection --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](flutter#8098)). </details>
1 parent ceb5fe4 commit db039c0

File tree

3 files changed

+176
-59
lines changed

3 files changed

+176
-59
lines changed

build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ jvmVersion = when (javaVersion) {
6464
"17" -> {
6565
JvmTarget.JVM_17
6666
}
67+
6768
"21" -> {
6869
JvmTarget.JVM_21
6970
}
71+
7072
else -> {
7173
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
7274
}
@@ -115,13 +117,16 @@ dependencies {
115117
// Plugin dependency documentation:
116118
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#plugins
117119
val bundledPluginList = mutableListOf(
120+
"com.google.tools.ij.aiplugin",
118121
"com.intellij.java",
119122
"com.intellij.properties",
120123
"JUnit",
121124
"Git4Idea",
122125
"org.jetbrains.kotlin",
123126
"org.jetbrains.plugins.gradle",
124-
"org.intellij.intelliLang")
127+
"org.jetbrains.plugins.yaml",
128+
"org.intellij.intelliLang"
129+
)
125130
val pluginList = mutableListOf("Dart:$dartPluginVersion")
126131
if (ideaProduct == "android-studio") {
127132
bundledPluginList.add("org.jetbrains.android")

flutter-idea/build.gradle.kts

Lines changed: 122 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ jvmVersion = when (javaVersion) {
4343
"17" -> {
4444
JvmTarget.JVM_17
4545
}
46+
4647
"21" -> {
4748
JvmTarget.JVM_21
4849
}
50+
4951
else -> {
5052
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
5153
}
@@ -62,9 +64,11 @@ javaCompatibilityVersion = when (javaVersion) {
6264
"17" -> {
6365
JavaVersion.VERSION_17
6466
}
67+
6568
"21" -> {
6669
JavaVersion.VERSION_21
6770
}
71+
6872
else -> {
6973
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
7074
}
@@ -92,12 +96,14 @@ dependencies {
9296
// Plugin dependency documentation:
9397
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#plugins
9498
val bundledPluginList = mutableListOf(
99+
"com.google.tools.ij.aiplugin",
95100
"com.intellij.java",
96101
"com.intellij.properties",
97102
"JUnit",
98103
"Git4Idea",
99104
"org.jetbrains.kotlin",
100105
"org.jetbrains.plugins.gradle",
106+
"org.jetbrains.plugins.yaml",
101107
"org.intellij.intelliLang",
102108
)
103109
val pluginList = mutableListOf("Dart:$dartPluginVersion")
@@ -178,62 +184,136 @@ dependencies {
178184
testImplementation(mapOf("group" to "org.mockito", "name" to "mockito-core", "version" to "5.2.0"))
179185
if (ideaProduct == "android-studio") {
180186
testImplementation(project(":flutter-studio"))
181-
testRuntimeOnly(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/plugins",
182-
"include" to listOf("**/*.jar"),
183-
"exclude" to listOf("**/kotlin-compiler.jar", "**/kotlin-plugin.jar", "**/kotlin-stdlib-jdk8.jar"))))
184-
compileOnly(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/lib",
185-
"include" to listOf("*.jar"),
186-
"exclude" to listOf("**/annotations.jar"))))
187-
testRuntimeOnly(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/lib",
188-
"include" to listOf("*.jar"))))
189-
compileOnly(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/plugins/git4idea/lib",
190-
"include" to listOf("*.jar"))))
191-
testImplementation(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/plugins/git4idea/lib",
192-
"include" to listOf("*.jar"))))
187+
testRuntimeOnly(
188+
fileTree(
189+
mapOf(
190+
"dir" to "${project.rootDir}/artifacts/android-studio/plugins",
191+
"include" to listOf("**/*.jar"),
192+
"exclude" to listOf("**/kotlin-compiler.jar", "**/kotlin-plugin.jar", "**/kotlin-stdlib-jdk8.jar")
193+
)
194+
)
195+
)
196+
compileOnly(
197+
fileTree(
198+
mapOf(
199+
"dir" to "${project.rootDir}/artifacts/android-studio/lib",
200+
"include" to listOf("*.jar"),
201+
"exclude" to listOf("**/annotations.jar")
202+
)
203+
)
204+
)
205+
testRuntimeOnly(
206+
fileTree(
207+
mapOf(
208+
"dir" to "${project.rootDir}/artifacts/android-studio/lib",
209+
"include" to listOf("*.jar")
210+
)
211+
)
212+
)
213+
compileOnly(
214+
fileTree(
215+
mapOf(
216+
"dir" to "${project.rootDir}/artifacts/android-studio/plugins/git4idea/lib",
217+
"include" to listOf("*.jar")
218+
)
219+
)
220+
)
221+
testImplementation(
222+
fileTree(
223+
mapOf(
224+
"dir" to "${project.rootDir}/artifacts/android-studio/plugins/git4idea/lib",
225+
"include" to listOf("*.jar")
226+
)
227+
)
228+
)
193229
} else {
194-
compileOnly(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/ideaIC/plugins/git4idea/lib",
195-
"include" to listOf("*.jar"))))
196-
compileOnly(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/ideaIC/plugins/java/lib",
197-
"include" to listOf("*.jar"))))
198-
testImplementation(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/ideaIC/plugins/git4idea/lib",
199-
"include" to listOf("*.jar"))))
230+
compileOnly(
231+
fileTree(
232+
mapOf(
233+
"dir" to "${project.rootDir}/artifacts/ideaIC/plugins/git4idea/lib",
234+
"include" to listOf("*.jar")
235+
)
236+
)
237+
)
238+
compileOnly(
239+
fileTree(
240+
mapOf(
241+
"dir" to "${project.rootDir}/artifacts/ideaIC/plugins/java/lib",
242+
"include" to listOf("*.jar")
243+
)
244+
)
245+
)
246+
testImplementation(
247+
fileTree(
248+
mapOf(
249+
"dir" to "${project.rootDir}/artifacts/ideaIC/plugins/git4idea/lib",
250+
"include" to listOf("*.jar")
251+
)
252+
)
253+
)
200254
}
201255
compileOnly("com.google.guava:guava:32.0.1-android")
202256
compileOnly("com.google.code.gson:gson:2.10.1")
203257
testImplementation("com.google.guava:guava:32.0.1-jre")
204258
testImplementation("com.google.code.gson:gson:2.10.1")
205259
testImplementation("junit:junit:4.13.2")
206-
runtimeOnly(fileTree(mapOf("dir" to "${project.rootDir}/third_party/lib/jxbrowser",
207-
"include" to listOf("*.jar"))))
208-
compileOnly(fileTree(mapOf("dir" to "${project.rootDir}/third_party/lib/jxbrowser",
209-
"include" to listOf("*.jar"))))
210-
testImplementation(fileTree(mapOf("dir" to "${project.rootDir}/third_party/lib/jxbrowser",
211-
"include" to listOf("*.jar"))))
260+
runtimeOnly(
261+
fileTree(
262+
mapOf(
263+
"dir" to "${project.rootDir}/third_party/lib/jxbrowser",
264+
"include" to listOf("*.jar")
265+
)
266+
)
267+
)
268+
compileOnly(
269+
fileTree(
270+
mapOf(
271+
"dir" to "${project.rootDir}/third_party/lib/jxbrowser",
272+
"include" to listOf("*.jar")
273+
)
274+
)
275+
)
276+
testImplementation(
277+
fileTree(
278+
mapOf(
279+
"dir" to "${project.rootDir}/third_party/lib/jxbrowser",
280+
"include" to listOf("*.jar")
281+
)
282+
)
283+
)
212284
}
213285

214286
sourceSets {
215287
main {
216-
java.srcDirs(listOf(
217-
"src",
218-
"third_party/vmServiceDrivers"
219-
))
288+
java.srcDirs(
289+
listOf(
290+
"src",
291+
"third_party/vmServiceDrivers"
292+
)
293+
)
220294
// Add kotlin.srcDirs if we start using Kotlin in the main plugin.
221-
resources.srcDirs(listOf(
222-
"src",
223-
"resources"
224-
))
295+
resources.srcDirs(
296+
listOf(
297+
"src",
298+
"resources"
299+
)
300+
)
225301
}
226302
test {
227-
java.srcDirs(listOf(
228-
"src",
229-
"testSrc/unit",
230-
"third_party/vmServiceDrivers"
231-
))
232-
resources.srcDirs(listOf(
233-
"resources",
234-
"testData",
235-
"testSrc/unit"
236-
))
303+
java.srcDirs(
304+
listOf(
305+
"src",
306+
"testSrc/unit",
307+
"third_party/vmServiceDrivers"
308+
)
309+
)
310+
resources.srcDirs(
311+
listOf(
312+
"resources",
313+
"testData",
314+
"testSrc/unit"
315+
)
316+
)
237317
}
238318
}
239319

flutter-studio/build.gradle.kts

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ jvmVersion = when (javaVersion) {
4343
"17" -> {
4444
JvmTarget.JVM_17
4545
}
46+
4647
"21" -> {
4748
JvmTarget.JVM_21
4849
}
50+
4951
else -> {
5052
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
5153
}
@@ -62,9 +64,11 @@ javaCompatibilityVersion = when (javaVersion) {
6264
"17" -> {
6365
JavaVersion.VERSION_17
6466
}
67+
6568
"21" -> {
6669
JavaVersion.VERSION_21
6770
}
71+
6872
else -> {
6973
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
7074
}
@@ -88,14 +92,16 @@ dependencies {
8892
// Plugin dependency documentation:
8993
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#plugins
9094
val bundledPluginList = mutableListOf(
95+
"com.google.tools.ij.aiplugin",
9196
"com.intellij.java",
9297
"com.intellij.properties",
9398
"JUnit",
9499
"Git4Idea",
95100
"org.jetbrains.kotlin",
96101
"org.jetbrains.plugins.gradle",
97-
"org.intellij.intelliLang",
98-
"org.intellij.intelliLang")
102+
"org.jetbrains.plugins.yaml",
103+
"org.intellij.intelliLang"
104+
)
99105
if (ideaProduct == "android-studio") {
100106
bundledPluginList.add("org.jetbrains.android")
101107
bundledPluginList.add("com.android.tools.idea.smali")
@@ -130,23 +136,49 @@ intellijPlatform {
130136
dependencies {
131137
compileOnly(project(":flutter-idea"))
132138
testImplementation(project(":flutter-idea"))
133-
compileOnly(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/lib",
134-
"include" to listOf("*.jar"))))
135-
testImplementation(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/lib",
136-
"include" to listOf("*.jar"))))
137-
compileOnly(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/plugins",
138-
"include" to listOf("**/*.jar"),
139-
"exclude" to listOf("**/kotlin-compiler.jar", "**/kotlin-plugin.jar"))))
140-
testImplementation(fileTree(mapOf("dir" to "${project.rootDir}/artifacts/android-studio/plugins",
141-
"include" to listOf("**/*.jar"),
142-
"exclude" to listOf("**/kotlin-compiler.jar", "**/kotlin-plugin.jar"))))
139+
compileOnly(
140+
fileTree(
141+
mapOf(
142+
"dir" to "${project.rootDir}/artifacts/android-studio/lib",
143+
"include" to listOf("*.jar")
144+
)
145+
)
146+
)
147+
testImplementation(
148+
fileTree(
149+
mapOf(
150+
"dir" to "${project.rootDir}/artifacts/android-studio/lib",
151+
"include" to listOf("*.jar")
152+
)
153+
)
154+
)
155+
compileOnly(
156+
fileTree(
157+
mapOf(
158+
"dir" to "${project.rootDir}/artifacts/android-studio/plugins",
159+
"include" to listOf("**/*.jar"),
160+
"exclude" to listOf("**/kotlin-compiler.jar", "**/kotlin-plugin.jar")
161+
)
162+
)
163+
)
164+
testImplementation(
165+
fileTree(
166+
mapOf(
167+
"dir" to "${project.rootDir}/artifacts/android-studio/plugins",
168+
"include" to listOf("**/*.jar"),
169+
"exclude" to listOf("**/kotlin-compiler.jar", "**/kotlin-plugin.jar")
170+
)
171+
)
172+
)
143173
}
144174

145175
sourceSets {
146176
main {
147-
java.srcDirs(listOf(
148-
"src",
149-
"third_party/vmServiceDrivers"
150-
))
177+
java.srcDirs(
178+
listOf(
179+
"src",
180+
"third_party/vmServiceDrivers"
181+
)
182+
)
151183
}
152184
}

0 commit comments

Comments
 (0)