Skip root module in Idea project

With the Idea plugin, is it possible to skip generating a root module in a multi-project-build? I want to generate one Idea project with all subprojects as modules, but no module for the root project (which has no content on its own)?

Try something like this (for the root project):

generateIdeaModule.enabled = false

Thanks, that prevents generating the module file. FTR, correct task name is:

ideaModule.enabled = false

But the project file still contains a reference to the (now missing) module. What exactly does the IdeaProject.modules property contain? Is it possible to remove a default module from it, e.g. with -=? What kind of object would I need to use as argument? TA file object for the module file? a String with the module name? Or?

Please see the Gradle Build Language Reference. You’ll have to defer setting ‘ideaProject.modules’ with something like ‘gradle.projectsEvaluated { … }’.

Great, that works! Full solution:

gradle.projectsEvaluated {
 gradle.rootProject {
     ideaModule.enabled = false
  idea {
   project {
    modules = subprojects*.idea.module
   }
  }
 }
}