Skip to content

Commit

Permalink
Explicitly pass platform prefix for some IDEs launched by gradle inte…
Browse files Browse the repository at this point in the history
…llij plugin

It's a temporary workaround for JetBrains/intellij-platform-gradle-plugin#1525
  • Loading branch information
Undin committed Jan 11, 2024
1 parent de30de3 commit 93fbe54
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions intellij-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ tasks {
jvmArgs("-Xmx2g")
jvmArgs("-Dide.experimental.ui=true")

// Temporary workaround for https://github.com/JetBrains/gradle-intellij-plugin/issues/1525
val platformPrefix = explicitPlatformPrefix()
if (platformPrefix != null) {
jvmArgs("-Didea.platform.prefix=$platformPrefix")
}

// Uncomment to show localized messages
// jvmArgs("-Didea.l10n=true")

Expand Down Expand Up @@ -871,6 +877,16 @@ fun <T : ModuleDependency> T.excludeKotlinDeps() {
exclude(module = "kotlin-stdlib-jdk8")
}

fun explicitPlatformPrefix(): String? {
return when (baseIDE) {
"idea" -> "idea"
"clion" -> "CLion"
"pycharm" -> "Python"
"studio" -> "AndroidStudio"
else -> null
}
}

fun loadProperties(path: String): Properties {
val properties = Properties()
file(path).bufferedReader().use { properties.load(it) }
Expand Down

0 comments on commit 93fbe54

Please sign in to comment.