intellij-platform-gradle-plugin icon indicating copy to clipboard operation
intellij-platform-gradle-plugin copied to clipboard

Use IDE original launcher for the runIDE task

Open jonnyzzz opened this issue 2 years ago • 1 comments

When debugging an IDE, it is necessary to make sure the IDE behaves exactly the same way as it does on user machines.

Right now, the runIde task uses that JavaExec and starts an IDE differently:

  • it uses an IDE .zip package which is different from os-specific packages
  • it does not use the bundled JBR when running it
  • it does not repeat the same logic of starting IDEs as done in the platform-native launchers (it always changes on the IDE side, the SDK tries to catch up)
  • started IDE does not have the right icon (a side-effect of the unsupported package being used)

It is possible to start an IDE from an official package too.

  • the same sandbox and properties can be used
  • all properties are easy to set via the vmoptions file
  • debugging is also possible by adding debug options to the vmoptions file (and clicking an attach debugger link in the IDE)
  • the compatible version of JBR is automatically there (there is no need to fetch yet another one via Gradle)

This change is huge, I understand that, but on the other hand, it can help to

  • simplify infrastructure (we use official releases only)
  • avoid too much complexity and support in the plugin SDK (no need to configure JavaExec, no need to fetch JBR, etc)
  • introduce fewer changes to the plugin run/debug environment
  • out of the box support for any third-party IntelliJ-based IDEs (e.g. by using product-info.json or via guessing based on known layout)

I have a proof of the concept if necessary

jonnyzzz avatar Jun 07 '22 09:06 jonnyzzz

AFAIU this would only work in newer releases so this has to be checked against minimum supported platform version for 2.x

YannCebron avatar Jun 22 '22 13:06 YannCebron

The 2.0 fully relies on the information provided with product-info.json file and uses bundled JBR, if available.

hsz avatar Mar 14 '24 15:03 hsz