Good morning, is there a way to check IDE version ...
# gradle
d
Good morning, is there a way to check IDE version from Gradle? I got a multiplatform project and script for import modules/composite-builds in my
gradle.settings.kts
, but the following problem: • Android Studio doesn’t work well with multiplatform projects yet • Cannot use IntelliJ because I got an Android module with Compose and AGP 4.2, so I got
This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.2 or newer.
So I’d like to exclude that Android module when I’m on IntelliJ
Not related to Gradle actually, but I found this:
Copy code
fun isIntelliJ() =
    System.getenv("__CFBundleIdentifier") == "com.jetbrains.intellij"
c
Copy code
if (settings.extra.has("android.injected.invoked.from.ide")) {
    tag("Android Studio")
  } else if (System.getenv("XPC_SERVICE_NAME")?.contains("intellij") == true) {
    tag("IntelliJ IDEA")
  } else if (System.getProperty("eclipse.buildId") == "true") {
    tag("Eclipse")
  } else if (!isCI) {
    tag("Cmd Line")
  }
d
I guess that's very outdated, as I don't have XPC_SERVICE_NAME in my env
c
It still works with the last intelliJ
(I'm using MacOs)
d
Ultimate? Perhaps is there in the community edition
c
Community in my case, but I should probably check and maybe use your solution. In any case you can use mine to detect AS
l
There's an idea active property that you could use instead and doesn't depend on the OS.