vscode-gradle
vscode-gradle copied to clipboard
Enable incremental build with Gradle build server to support hot code replace
Opening a Gradle project with a Gradle build server currently results in the loss of the hot reload feature. This is because the build server does not support auto build and the Java debugger has no way to obtain the modified classes from the build server.
This is a feature that I missed alot when debugging. One reason to go back to JDT LS builds
Any plans to open source the Gradle build server code ?
It will happen in this week :)
No updates?
I miss this feature, too
had same problem...
Any plans to implement this feature?
Need it!
Need it! 2
Received
On Mon, May 13, 2024, 12:48 AM 0gon @.***> wrote:
Need it! 2
— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-gradle/issues/1449#issuecomment-2106702645, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFKPRUCSUR2ZF3GTSKSKNSLZCBHZ3AVCNFSM6AAAAAA7CNTY3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWG4YDENRUGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Some investigation result and thoughts:
Root cause
Since the build is delegated to the gradle, no resource change event is notified to workspace. Thus, The resource change listener in java debugger will not know which class file is updated.
Solution
- To solve the synchronization issue between the workspace and the file system. A
refreshLocal()needs to be called for the build folder after gradle build finishes. - Debugger needs to find the main project based on the main class name in the context.
- If the project is a gradle build server project, since auto build for Gradle build server project will not update
.classfiles, we need to trigger an additional incremental build.
One thing needs to pay attention is the performance. refreshLocal(), find main project based on main class name & delegate build to gradle are all time consuming actions. At least, the progress reporter should be clear to tell users what's going on.