You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JDK we currently use on CI is 21.0.1. The exact version is important as it is written into module-info.class files. That's why we add it as input. Gradle's toolchain mechanism currently only tracks the major version. That's why we need the full version as a separate input:
(Note: the code is not 100% correct atm. It uses the version of the JDK running Gradle. On local machines, this may be a different version than the one provisioned by toolchains if Gradle is started with a different "major" JDK.)
Right now, users starting Gradle with a different JDK than 21.0.1 will not get any remote cache hits for compilation!
If we can't get this working reliably with toolchains (see gradle/gradle#16628 (comment)) we should probably make sure the version we want is exactly the one Gradle was started with and let Gradle use that one. For that we could do a more precise version of the check proposed in: #12780
The text was updated successfully, but these errors were encountered:
jjohannes
changed the title
Gradle: Find a way to use the same JDK major.minor.patch version everywhere
Gradle: Exact JDK version (major.minor.patch) provisioning
May 7, 2024
jjohannes
changed the title
Gradle: Exact JDK version (major.minor.patch) provisioning
Gradle Build: Exact JDK version (major.minor.patch) provisioning
May 7, 2024
The implemented solution solves the problem. Closing this issue, since there is nothing we can improve until Gradle core delivers new/better features in the future.
The JDK we currently use on CI is
21.0.1
. The exact version is important as it is written intomodule-info.class
files. That's why we add it as input. Gradle's toolchain mechanism currently only tracks the major version. That's why we need the full version as a separate input:https://github.com/hashgraph/hedera-services/blob/develop/build-logic/project-plugins/src/main/kotlin/com.hedera.hashgraph.java.gradle.kts#L126-L130
(Note: the code is not 100% correct atm. It uses the version of the JDK running Gradle. On local machines, this may be a different version than the one provisioned by toolchains if Gradle is started with a different "major" JDK.)
Right now, users starting Gradle with a different JDK than
21.0.1
will not get any remote cache hits for compilation!If we can't get this working reliably with toolchains (see gradle/gradle#16628 (comment)) we should probably make sure the version we want is exactly the one Gradle was started with and let Gradle use that one. For that we could do a more precise version of the check proposed in: #12780
The text was updated successfully, but these errors were encountered: