vscode-gradle
vscode-gradle copied to clipboard
Have run configurations and tests use Gradle
Is your feature request related to a problem? Please describe. I have a project that uses Gradle. The only way to successfully compile and run it is through Gradle. It would be better if the run configurations and tests would leverage Gradle. As it stands, I do not see a way to run individual tests when your project depends on Gradle other than via the command line.
The current alternative is to use the Gradle extension's task UI. You can choose to run or debug a task, or run it with command line args. This is fine for running pre-made tasks, but clumsy for running tests, and the task UI provides no customization options you can reuse. It also is not intuitive to anyone who is not familiar with Gradle or java projects, and are expecting the project to work like it would in any other language, since it requires ignoring the existing run and test features.
Describe the solution you'd like We can create Gradle run configurations and also define test behavior. Note, also, different test directories in the same project may have different Gradle tasks. It's also worth calling out that Gradle supports watching file changes, which may be a useful mechanism for automatically running tests.
Describe alternatives you've considered None.
Other info The project defines class paths and does not appear to be misconfigured in any obvious way.
I'm also working in a project environment where the applications only successfully launch when executed with Gradle. (though compilation is successful either way) In my case his is most certainly caused by some missing configuration that is done in the warp/init script deployed with the custom wrapper distribution that is used for the projects.
This is not a problem for IntelliJ IDEA because there it is actually the default behavior to run and test using the build tool in Gradle projects (not changeable in the community edition). When setting IDEA to run using the IDE, the application produces the exact same error on launch as with VS Code.
Therefore I guess the solution would be to add a new setting to delegate build/run actions to Gradle which should also help with mixed source (Java/Groovy/Kotlin) projects.
This gets my vote. This would be the last detail making me switch to VS Code for Gradle project development
To clarify, is this to support a gradle launch configuration in launch.json?