I would like to include different parts of a settings.gradle.kts file depending on whether a project is compiled with IntelliJ IDEA or Android Studio.
For my purposes, I only need to know if the project is compiled with Android Studio or not, as certain mobile-specific modules of the project can only be compiled with Android Studio.
Since the modules are distinguished in the settings gradle kotlin script file, I hope to find a solution where a simple if includes those modules accordingly. Thus far I've been commenting out the relevant modules when working in IDEA.
There are two relevant properties that are set in Android Studio/IntelliJ IDEA:
idea.paths.selector
, which in default instalations has a value such as "AndroidStudioPreview2021.1" or "IntelliJIdea2021.2", so you could use this if you needed to know if it was either:idea.platform.prefix
, which seems to only be set for Android Studio, with a value of "AndroidStudio", so it works for my case:Thank you @Konstantin Annikov for notifying me about another similar question that was never fully answered but was on the right track (using properties)