microsoft / build-server-for-gradle

An implementation of the Build Server Protocol for Gradle
MIT License
45 stars 7 forks source link

Shift sourceset population out of buildInitialize #135

Closed Arthurm1 closed 2 months ago

Arthurm1 commented 2 months ago

Metals (BSP client) expects a prompt response to build/initialize and if it doesn't get one within 30 seconds it assumes the build server has not started correctly and so attempts to restart it.

Large projects take longer than this because the sourceset population takes a long time.

This shifts the population of sourcesets away from build/initialize and into workspace/buildTargets

It also shifts the responsibility of handling workspace/reload away from LifecycleService and into BuildTargetService. The LifecycleService code was similar to that RefetchBuildTargetTask so this allows doing away with RefetchBuildTargetTask and also means that any call to workspace/reload will cause a buildTarget/didChange event if the workspace has changed - which wasn't the case before.

Arthurm1 commented 2 months ago

@jdneo rebased

jdneo commented 2 months ago

Thank you @Arthurm1