Skip to content

Refactor product handling logic in build script #8086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* found in the LICENSE file.
*/

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

Expand All @@ -109,12 +112,11 @@ dependencies {
"org.jetbrains.kotlin",
"org.jetbrains.plugins.gradle",
"org.intellij.intelliLang")
val pluginList = mutableListOf("Dart:$dartPluginVersion")
if (ideaProduct == "android-studio") {
bundledPluginList.add("org.jetbrains.android")
bundledPluginList.add("com.android.tools.idea.smali")
}
val pluginList = mutableListOf("Dart:$dartPluginVersion")
if (ideaProduct == "IC") {
} else {
pluginList.add("org.jetbrains.android:$androidPluginVersion")
}

Expand Down Expand Up @@ -214,4 +216,4 @@ tasks {
dependsOn(":flutter-studio:prepareSandbox")
}
}
}
}
11 changes: 7 additions & 4 deletions flutter-idea/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ dependencies {
if (ideaProduct == "android-studio") {
androidStudio(ideaVersion)
} else { // if (ideaProduct == "IC") {
intellijIdeaCommunity(ideaVersion)
when (ideaProduct) {
"IU" -> intellijIdeaUltimate(ideaVersion)
"IC" -> intellijIdeaCommunity(ideaVersion)
else -> throw IllegalArgumentException("ideaProduct must be defined in the product matrix as either \"IU\" or \"IC\", but is not for $ideaVersion")
}
}
testFramework(TestFrameworkType.Platform)

Expand All @@ -89,12 +93,11 @@ dependencies {
"org.jetbrains.plugins.gradle",
"org.intellij.intelliLang",
)
val pluginList = mutableListOf("Dart:$dartPluginVersion")
if (ideaProduct == "android-studio") {
bundledPluginList.add("org.jetbrains.android")
bundledPluginList.add("com.android.tools.idea.smali")
}
val pluginList = mutableListOf("Dart:$dartPluginVersion")
if (ideaProduct == "IC") {
} else {
pluginList.add("org.jetbrains.android:$androidPluginVersion")
}

Expand Down