Gradle multi-project to IDEA module mapping issue
已回答
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
- nested Gradle sub-projects would have been grouped together in IDEA's Project module structure (Project Structure->Modules). Instead everything is flat.
- 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.
请先登录再写评论。
Please submit a bug at https://youtrack.jetbrains.com/issues/IDEA with a sample project to reproduce.