But if I understand correctly (from the answer to this question, for example), changes applied via withXml
won’t take effect if you import the project using IntelliJ’s Gradle plugin, and yet using IntelliJ’s Gradle plugin appears to be the officially recommended way to work with IntelliJ since at least 2013 (based on the comments on the original question).
As I understand it, doing this workaround requires that we run gradle ideaModules
but don’t import the project as a Gradle project in IntelliJ, but then most of the IDE integration niceties won’t work. Or, we can first import the project as a Gradle project in IntelliJ, then go back to the command line and run the ideaModules
task, but then anytime we use the IntelliJ Gradle plugin’s “refresh project” option we’d lose the change to the modules unless we went back and ran gradle ideaModules
again. Is that correct?