microsoft / build-server-for-gradle

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

Build for Java 8 #117

Closed Arthurm1 closed 1 month ago

Arthurm1 commented 6 months ago

Since Gradle can run on Java 8 and so do some BSP clients, it would be good to build the plugin/server/model for java 8

Currently the project requires Java 17 but I think there are only a few instances of use of java syntax > version 8 and these could be easily changed.

jdneo commented 6 months ago

Is it required by Metals?

Arthurm1 commented 6 months ago

Not required no. Metals will run on >=8. But it crops up that some users are still on 8.

Not sure what the oldest version of Gradle is that you want to support but requiring jdk 17 will mean that the min gradle version is 7.3... https://docs.gradle.org/current/userguide/compatibility.html

Maybe better to leave this issue until someone actually needs it for their project.

Arthurm1 commented 6 months ago

But looking at Android - it's minimum java version is 11 so 🤷

jdneo commented 6 months ago

Ah, I see.

The build server running on java 17 not necessarily means that gradle daemon runs on 17 too.

Client can pass a list of jdk installations during initialization: https://github.com/microsoft/build-server-for-gradle/blob/b77ecfd4163b23a16a01068df111c98d56874044/server/src/main/java/com/microsoft/java/bs/core/internal/model/Preferences.java#L58

And server will pick the matchest jdk for gradle (call .setJavaHome(xxx) when using tooling api): https://github.com/microsoft/build-server-for-gradle/blob/b77ecfd4163b23a16a01068df111c98d56874044/server/src/main/java/com/microsoft/java/bs/core/internal/services/LifecycleService.java#L182

jdneo commented 1 month ago

No related plans in the short term, close for now.