Big Multi-module project - open only needed module in IDE

Hi,
We have a big multi module project (~2 million LOC, ~20 modules).
When we import this project into Eclipse or Idea we need to create all of the projects, which is fine I guess. However, when working, we would like to keep a single module open at a time, regardless of the dependencies among modules.
This would come for free with Maven in Eclipse, whereas I don’t think Idea’s design would allow this at all.
Is this possible without hacking our lives off with Gradle?
Thanks in advance

A few options discussed here

Thanks a lot, it kind of presents three solutions we already got to.
Ideally we’d like the end developers not to mess around with build files locally when they decide to open a project or two.

Thanks for your reply.

If your eclipse-fu (or intellij-fu) is good enough you could write a gradle plugin to conditionally apply dependency substitution rules based on an eclipse (or intellij) workspace location.

Perhaps @donat knows how to programmatically list the projects given an eclipse workspace location?

For the time being Buildship only support full imports. But, there is an ongoing work being spec’d out to allow the users to import a subset of a project: https://github.com/gradle/gradle/blob/master/design-docs/ide-integration.md#feature---developer-uses-subset-of-projects-for-a-gradle-build-from-ide
Please note this is desing-in-progress and we have no strict timeline for it.

Thanks @donat but I was actually wanting a workaround solution to apply dependency substitution rules programmatically (via build.gradle) and NOT in an eclipse plugin (or buildship)

Is there a way that we can list the open projects in an eclipse workspace (given the path to the workspace directory) from a gradle plugin (not an eclipse plugin)

I’m guessing this would require invoking eclipse api’s from gradle (or maybe parsing a workspace xml file?) I’m guessing that the .metadata folder has something useful but the files seem to be a custom binary format.

This would mean that buildship and gradle command line would build the same

Right now I can only see a hacky solution. From Buildship you can access Gradle but not the other way around. So form a build script you’d have to manually specify the ${ws_location}/.metadata./plugins/org.eclipse.core.resources/.projects folder and parse the content of the contained ${plugin-name}/.location files. Then you’d have to compare the found locations with the project folders retrieved from Gradle.

Yes, that’s the sort of approach I was thinking of. I’m not familiar with eclipse API’s, is there an API we can invoke to parse the .location files?

I asked a question on stack overflow here