Skip to content

Commit 80abea5

Browse files
authored
Support more options for running with runIdeVariant (#4960)
1 parent 84b50bc commit 80abea5

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

buildSrc/src/main/kotlin/software/aws/toolkits/gradle/intellij/IdeVersions.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ import org.gradle.api.Project
77
import org.gradle.api.provider.Provider
88
import org.gradle.api.provider.ProviderFactory
99

10-
11-
enum class IdeFlavor { GW, IC, IU, RD }
10+
/** The subset of [org.jetbrains.intellij.platform.gradle.IntelliJPlatformType] that are relevant to us **/
11+
enum class IdeFlavor {
12+
GW,
13+
/* free */
14+
AI, IC, PC,
15+
/* paid */
16+
/* RR is 'non-commerical free' but treat as paid */
17+
DB, CL, GO, IU, PS, PY, RM, RR, WS,
18+
RD,
19+
}
1220

1321
object IdeVersions {
1422
private val commonPlugins = listOf(
@@ -21,7 +29,6 @@ object IdeVersions {
2129
Profile(
2230
name = "2023.3",
2331
community = ProductProfile(
24-
sdkFlavor = IdeFlavor.IC,
2532
sdkVersion = "2023.3",
2633
bundledPlugins = commonPlugins + listOf(
2734
"com.intellij.java",
@@ -34,7 +41,6 @@ object IdeVersions {
3441
)
3542
),
3643
ultimate = ProductProfile(
37-
sdkFlavor = IdeFlavor.IU,
3844
sdkVersion = "2023.3",
3945
bundledPlugins = commonPlugins + listOf(
4046
"JavaScript",
@@ -58,7 +64,6 @@ object IdeVersions {
5864
Profile(
5965
name = "2024.1",
6066
community = ProductProfile(
61-
sdkFlavor = IdeFlavor.IC,
6267
sdkVersion = "2024.1",
6368
bundledPlugins = commonPlugins + listOf(
6469
"com.intellij.java",
@@ -72,7 +77,6 @@ object IdeVersions {
7277
)
7378
),
7479
ultimate = ProductProfile(
75-
sdkFlavor = IdeFlavor.IU,
7680
sdkVersion = "2024.1",
7781
bundledPlugins = commonPlugins + listOf(
7882
"JavaScript",
@@ -97,12 +101,10 @@ object IdeVersions {
97101
Profile(
98102
name = "2024.2",
99103
gateway = ProductProfile(
100-
sdkFlavor = IdeFlavor.GW,
101104
sdkVersion = "242.20224-EAP-CANDIDATE-SNAPSHOT",
102105
bundledPlugins = listOf("org.jetbrains.plugins.terminal")
103106
),
104107
community = ProductProfile(
105-
sdkFlavor = IdeFlavor.IC,
106108
sdkVersion = "2024.2",
107109
bundledPlugins = commonPlugins + listOf(
108110
"com.intellij.java",
@@ -116,7 +118,6 @@ object IdeVersions {
116118
)
117119
),
118120
ultimate = ProductProfile(
119-
sdkFlavor = IdeFlavor.IU,
120121
sdkVersion = "2024.2",
121122
bundledPlugins = commonPlugins + listOf(
122123
"JavaScript",
@@ -151,7 +152,6 @@ object IdeVersions {
151152
}
152153

153154
open class ProductProfile(
154-
val sdkFlavor: IdeFlavor,
155155
val sdkVersion: String,
156156
val bundledPlugins: List<String> = emptyList(),
157157
val marketplacePlugins: List<String> = emptyList()
@@ -164,7 +164,7 @@ class RiderProfile(
164164
val nugetVersion: String, // https://www.nuget.org/packages/JetBrains.Rider.SDK/
165165
bundledPlugins: List<String> = emptyList(),
166166
marketplacePlugins: List<String> = emptyList(),
167-
) : ProductProfile(IdeFlavor.RD, sdkVersion, bundledPlugins, marketplacePlugins)
167+
) : ProductProfile(sdkVersion, bundledPlugins, marketplacePlugins)
168168

169169
class Profile(
170170
val name: String,

buildSrc/src/main/kotlin/software/aws/toolkits/gradle/intellij/ToolkitIntelliJExtension.kt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,22 @@ abstract class ToolkitIntelliJExtension(private val providers: ProviderFactory)
2020

2121
fun productProfile(): Provider<out ProductProfile> = ideFlavor.flatMap { flavor ->
2222
when (flavor) {
23-
IdeFlavor.IC -> ideProfile().map { it.community }
24-
IdeFlavor.IU -> ideProfile().map { it.ultimate }
23+
IdeFlavor.AI,
24+
IdeFlavor.IC,
25+
IdeFlavor.PC,
26+
-> ideProfile().map { it.community }
27+
28+
IdeFlavor.DB,
29+
IdeFlavor.CL,
30+
IdeFlavor.GO,
31+
IdeFlavor.IU,
32+
IdeFlavor.PS,
33+
IdeFlavor.PY,
34+
IdeFlavor.RM,
35+
IdeFlavor.RR,
36+
IdeFlavor.WS,
37+
-> ideProfile().map { it.ultimate }
38+
2539
IdeFlavor.RD -> ideProfile().map { it.rider }
2640
IdeFlavor.GW -> ideProfile().map { it.gateway!! }
2741
}

0 commit comments

Comments
 (0)