Control automatic creation of IDEA modules from Gradle sourceSets in 2016.1?

和自甴很熟 提交于 2020-01-02 03:42:27

问题


Starting with IntelliJ IDEA 2016.1, IDEA automatically creates IntelliJ modules from Gradle SourceSets (link). While I recognize that this was a major step forward for many reasons, it is also a major change for existing projects which relied on IDEA being source set agnostic. I currently get over 50 new modules that I don't want ...

Do you know of a way to restore IntelliJ's old behavior?

Is there a way to control how modules are created from source sets, for example by excluding a sourceset?

I already checked the Gradle IDEA plugin docs but could not find a solution. I also tried this but it seems to apply only to multi-module projects, not to the source set problem.
I am using Gradle 2.12 and, obviously, IDEA 2016.1.


回答1:


Currently there is no way of controlling the automatic creation of modules based on projects sourceSets.

There are quite a lot issues regarding this problem:

https://youtrack.jetbrains.com/issue/IDEA-153231

https://youtrack.jetbrains.com/issue/IDEA-154014

https://youtrack.jetbrains.com/issue/IDEA-153264

Edit:

Since IntelliJ IDEA 2016.1.2 (I think) there is a new option "Create separate module per source set" on "Import Project from Gradle" dialog:



来源:https://stackoverflow.com/questions/36330542/control-automatic-creation-of-idea-modules-from-gradle-sourcesets-in-2016-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!