cashapp / licensee

Gradle plugin which validates the licenses of your dependency graph match what you expect
https://cashapp.github.io/licensee/docs/1.x/
Apache License 2.0
637 stars 30 forks source link

Use the incubating JVM toolchain feature to run Gradle daemon #343

Open hfhbd opened 4 months ago

hfhbd commented 4 months ago

There is a new feature from Gradle 8.8 to use the jvm toolchain feature for the daemon: https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:daemon_jvm_criteria

And why do we use 21 in builds, but 11 in releases?

JakeWharton commented 4 months ago

The build JDK should always be the newest. The source and target bytecode version should be the minimum supported version. Toolchains should only be used for testing on old JDKs or running tools that don't work on modern JDKs.

hfhbd commented 4 months ago

This feature is about the JVM used by the daemon itself, not about the JVM used for compiling, although without specifying the compiling tasks, it's the same JVM, but we do specify the compiler options.

JakeWharton commented 4 months ago

Yeah but then this forces the use of JDK 11 which is ancient. I should be able to use any JDK from 11-22. 22 is my default, and anything that uses a toolchain, aside from for testing purposes, will waste my disk space and RAM for worse performance.

hfhbd commented 4 months ago

We can also use 22, but we already use the toolchains feature for compiling with Java 11 and for testing with Java 20

If you want to drop toolchains for compiling, we also should add test with JVM 11.

JakeWharton commented 3 months ago

That would be my preference. One should be able to compile on any JDK newer than or equal to our minimum, and we should be testing on the latest + the minimum... uh... at minimum.