Skip to content

Commit 8ea3b61

Browse files
authored
Refactor product handling logic in build script (flutter#8086)
Adds handling for the "IU" (Idea Ultimate) product variant, currently skipped over and failing builds due to android plugin dependency logic being tied to "IC". This conflicts with the [contributing.md](https://github.com/flutter/flutter-intellij/blob/944aa028132052a6d14a99e073ebe4c7e5525ce3/CONTRIBUTING.md#L111): > ... > 1. Make sure you're using the latest stable release of IntelliJ, > or download and install the latest version of IntelliJ (2023.1 or later). > - [IntelliJ Downloads](https://www.jetbrains.com/idea/download/) > - **Either the community edition (free) or Ultimate will work.** <-- no it won't > > 2. Create a `gradle.properties` file. > ...
1 parent 0f9e2a0 commit 8ea3b61

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* found in the LICENSE file.
55
*/
66

7-
import org.jetbrains.intellij.platform.gradle.IntelliJPlatform
87
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
98
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
109
import org.jetbrains.intellij.platform.gradle.models.ProductRelease
@@ -94,8 +93,12 @@ dependencies {
9493
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#default-target-platforms
9594
if (ideaProduct == "android-studio") {
9695
androidStudio(ideaVersion)
97-
} else { // if (ideaProduct == "IC") {
98-
intellijIdeaCommunity(ideaVersion)
96+
} else {
97+
when (ideaProduct) {
98+
"IU" -> intellijIdeaUltimate(ideaVersion)
99+
"IC" -> intellijIdeaCommunity(ideaVersion)
100+
else -> throw IllegalArgumentException("ideaProduct must be defined in the product matrix as either \"IU\" or \"IC\", but is not for $ideaVersion")
101+
}
99102
}
100103
testFramework(TestFrameworkType.Platform)
101104

@@ -109,12 +112,11 @@ dependencies {
109112
"org.jetbrains.kotlin",
110113
"org.jetbrains.plugins.gradle",
111114
"org.intellij.intelliLang")
115+
val pluginList = mutableListOf("Dart:$dartPluginVersion")
112116
if (ideaProduct == "android-studio") {
113117
bundledPluginList.add("org.jetbrains.android")
114118
bundledPluginList.add("com.android.tools.idea.smali")
115-
}
116-
val pluginList = mutableListOf("Dart:$dartPluginVersion")
117-
if (ideaProduct == "IC") {
119+
} else {
118120
pluginList.add("org.jetbrains.android:$androidPluginVersion")
119121
}
120122

@@ -214,4 +216,4 @@ tasks {
214216
dependsOn(":flutter-studio:prepareSandbox")
215217
}
216218
}
217-
}
219+
}

flutter-idea/build.gradle.kts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ dependencies {
7474
if (ideaProduct == "android-studio") {
7575
androidStudio(ideaVersion)
7676
} else { // if (ideaProduct == "IC") {
77-
intellijIdeaCommunity(ideaVersion)
77+
when (ideaProduct) {
78+
"IU" -> intellijIdeaUltimate(ideaVersion)
79+
"IC" -> intellijIdeaCommunity(ideaVersion)
80+
else -> throw IllegalArgumentException("ideaProduct must be defined in the product matrix as either \"IU\" or \"IC\", but is not for $ideaVersion")
81+
}
7882
}
7983
testFramework(TestFrameworkType.Platform)
8084

@@ -89,12 +93,11 @@ dependencies {
8993
"org.jetbrains.plugins.gradle",
9094
"org.intellij.intelliLang",
9195
)
96+
val pluginList = mutableListOf("Dart:$dartPluginVersion")
9297
if (ideaProduct == "android-studio") {
9398
bundledPluginList.add("org.jetbrains.android")
9499
bundledPluginList.add("com.android.tools.idea.smali")
95-
}
96-
val pluginList = mutableListOf("Dart:$dartPluginVersion")
97-
if (ideaProduct == "IC") {
100+
} else {
98101
pluginList.add("org.jetbrains.android:$androidPluginVersion")
99102
}
100103

0 commit comments

Comments
 (0)