How to configure a Gradle command-line switch

I have a multi-project Gradle build with about 200 sub-projects. When I open the

file in IntelliJ, an IntelliJ project with all these sub-projects as modules is created. I have two problems with this:
  1. I only work on a small subset of this project, so I prefer to have only those open in IntelliJ
  2. IntelliJ collates dependencies from all sub-projects into a single flat list and uses that in the
    whenever I run any class from within the IDE.

For legacy reasons, I cannot break the project into disjoint subsets. So I created a

file with only the parts of the project I care about (and ignored this from version control, so the rest of the team will not get it). This works great on the command-line when I invoke gradle with the
--settings-file my.settings.gradle
flag. I have couple of questions:
  1. How do I force Gradle to pick up my custom
    file when I run
    from within my project tree?
  2. How do I make IntelliJ pick the

I am using IntelliJ IDEA 13.1.3 and Gradle 2.1.

(cross-posted at StackOverflow)

Please sign in to leave a comment.