devonfw / ide

Tool to automate setup and update of development environment (esp. for Java projects).
Apache License 2.0
33 stars 102 forks source link

Open workspace as project when launching Intellij and Android Studio #1358

Closed hohwille closed 9 months ago

hohwille commented 9 months ago

In order to properly fix #1305 and also to improve configuration and customization of Intellij via devonfw-ide we have to open IDEA based IDEs with the workspace as argument and "project folder" to open. This allows IDE admins to manage configurations that are located in the .idea folder. Before the end-user did open any project folder (sub-folder of the workspace or even outside of it) with his project to work on. Then the .idea folder is created inside this project folder. A problem is that IDEA made some bad design decisions to place important configurations for maven, Java compiler, etc. inside the .idea folder. As we can not know what project folder the user is going to open after he has launched Intellij via devonfw-ide we have no chance to make changes inside this .idea folder that can be anywhere. The new approach therefore uses the workspace as project folder and Intellij easily allows users to import sub-folders in the workspace e.g. as maven projects.

However, this is causing a breaking change. Further some projects might be used to have the .idea folder with some parts of the config in their project git repository. With this change we would cause quite some trouble for such projects and prevent them to continue working as usual after upgrading their devonfw-ide. Therefore we need to introduce a variable that allows to disable the new behavior so projects can get backward compatibility:

INTELLIJ_DISABLE_OPEN_WORKSPACE=true
ANDROID_STUDIO_DISABLE_OPEN_WORKSPACE=true

Then project admins can add this property to devon.properties in their settings so noting will break if developers install the latest devonfw-ide with the new features and fixes.