How to configure a Gradle command-line switch

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

build.gradle
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
    CLASSPATH
    whenever I run any class from within the IDE.


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

my.settings.gradle
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
    my.settings.gradle
    file when I run
    gradle
    from within my project tree?
  2. How do I make IntelliJ pick the
    my.settings.gradle
    file?


I am using IntelliJ IDEA 13.1.3 and Gradle 2.1.

(cross-posted at StackOverflow)

Please sign in to leave a comment.