Gradle projects compile to `bin/` instead of `build/`
Gradle projects default their builds to build/, however the vscode plugin compiles a completely separate version of all the class files to bin/, so it does require adding a completely separate directory to source control, along with actually performing all the compiles twice (once for gradle, and once for vscode).
Originally posted by @ThadHouse in https://github.com/redhat-developer/vscode-java/issues/466#issuecomment-373542235
Was looking for a solution for my problem when I stumbled upon this mentioned comment.
The problem here is the Java extension for VS Code compiles binaries to bin/ directly.
Is there a way for VS Code to follow Gradle's settings for the build folder?
@brunovieira97 You may want to take a look at https://github.com/eclipse/buildship/issues/1131
Wasn't aware of this Buildship project.
However, Maven support does not seem to be affected at all. AFAIK, it just compiles binaries directly to target/, same as Eclipse (in this case, VS Code).
Wasn't aware of this Buildship project.
See
- https://github.com/redhat-developer/vscode-java/wiki/Gradle-Support
- https://github.com/redhat-developer/vscode-java/issues/1615#issue-701705496
I don't think java extension even uses gradle to build these classes. I have registered a task with
classes.finalizedBy mergeMethods
And none of the changes got applied by this task.
Additionally, debug extension uses bin/ for runtime classpath which caused issues due to my task not applying these changes