Gradle multi-project to IDEA module mapping issue

Answered

 

I have a multi-project Gradle build that I've linked to IDEA.  Everything works okay, however the structure in IDEA is not as I was expecting.

The commands gradle projects and gradle -gui both show a hierarchical project structure, IDEA shows same thing flattened

  1.  nested Gradle sub-projects would have been grouped together in IDEA's Project module structure (Project Structure->Modules). Instead everything is flat.
  2. In the Gradle Tool window the projects are also all flat and not hierarchical.

"Create separate module per source set is not set"

Example:



rootProject\
├───build.gradle
├───settings.gradle
|
├───sub-project-1\
│ └───build.gradle
├───sub-project-2\
│ └───build.gradle
|
├──sub-project-3\
│ ├───sub-project-3a\
│ | └───build.gradle
│ ├───sub-project-3b\
│ | └───build.gradle
│ └───sub-project-3c\
│ └───build.gradle
|
├───sub-project-4\
│ └───build.gradle
...
├───moduleN\
│ └───build.gradle

...

 

For sub-project-3 (which in gradle is just a container It has no build script and gets nothing injected by another build script) I would expect IDEA to be smart enough to show  3a, 3b, and 3c grouped together.  This makes it much easier to navigate and mimics how the projects are shown/used/interacted with in Gradle.

 

The structure does show okay in the Project tool pane.

1 comment
Comment actions Permalink

Please submit a bug at https://youtrack.jetbrains.com/issues/IDEA with a sample project to reproduce.

0

Please sign in to leave a comment.