JetBrains / intellij-platform-gradle-plugin

Gradle plugin for building plugins for IntelliJ-based IDEs
https://plugins.jetbrains.com/docs/intellij/gradle-prerequisites.html
Apache License 2.0
1.43k stars 271 forks source link

support of remote dev #894

Open akosyakov opened 2 years ago

akosyakov commented 2 years ago

At Gitpod we are building a plugin for JB backend: https://github.com/gitpod-io/gitpod/tree/main/components/ide/jetbrains/backend-plugin

In order to test we have to run in Gitpod workspace container which does not have UI and does not need it since we use Gateway and thin client to connect. Running it locally is not the option since we need Gitpod workspace services for this plugin to work.

Unfortunately ./gradlew runIde although does not start IDE in headless more akin to remote-dev-server plugin. It would be good if such use case is supported as well 🙏

As for now we built a custom shell script to launch the same JB backend with built plugin in remote mode. It gets us going but having something more native would be better.

hsz commented 2 years ago

@akosyakov Don't you mind sharing more details on this approach? What exactly would be helpful to introduce in the Gradle IntelliJ Plugin?

akosyakov commented 2 years ago

I would like to run something like ./gradlew runIde --headless which starts IDE in the backend mode with my plugin.

Right now we emulate something like that with custom shell script: https://github.com/gitpod-io/gitpod/blob/main/components/ide/jetbrains/backend-plugin/launch-dev-server.sh

hsz commented 2 years ago

What about

tasks {
    runIde {
        systemProperty("java.awt.headless", "true")
    }
}
akosyakov commented 2 years ago

It fails with:

No valid license found
2022-03-30 12:10:00,754 [   2096]  ERROR -                #LicenseManager - No valid license found 
java.lang.Throwable: No valid license found

I'm actually not sure that just enabling headless mode is enough, if you look at ./plugins/remote-dev-server/bin/launcher.sh of JB backend it changes idea properties to disable some things.

fkorotkov commented 3 months ago

I want to bump this thread. In my use case the IntelliJ plugin is a part of a mono repo and the build reliably works on Ubuntu hosts only. Our dev machines are MacBooks and we are looking into using Gateway for plugin development as well.

Is there a way we can run the headless IntelliJ on the dev machine and connect to it from Gateway? Maybe via "Connect to Running IDE" option?