"Reload Gradle" overwrites "project name"
In our settings.gradle file, we set the project name like:
rootProject.name = "foo"
First time I open it with IntelliJ, the project shows up in the toolbox "Projects" as foo. Fine.
When I rename the project (using "Project structure", to then change "Project name") to say bar ... works, too.
The projects windows does show me bar.
But occasionally, I have to hit the "Reload all gradle projects" icon because something else in our setup changed, and needs to be reloaded.
Then IntelliJ ignores the fact that I provided a different project name, so I end up with foo again.
It is sure okay that when loading the project the first time IntelliJ picks the project name from the gradle setup.
But what is the point of being able to make a manual change that doesn't survive a "gradle reload"?
请先登录再写评论。
Hello,
I suppose Project Structure dialog shouldn't be used to edit projects imported from Gradle. Even if you rename a module in it, the changes you made will be lost after the project is synched with Gradle as we use Gradle files as an initial source for project configuration. Here is a request to show notifications for such cases: https://youtrack.jetbrains.com/issue/IDEA-238046.
UseCase:
I have several projects based on the same sources (different branches). And I'd like to distinguish these projects somehow when opening Recent Projects.
Pdyoma
You can do it in the settings.gradle file of each project:
The issue itself is a known one. Please upvote https://youtrack.jetbrains.com/issue/IDEA-153554