File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,8 +34,12 @@ application {
3434version = " 1.8.1.0"
3535
3636java {
37- toolchain { languageVersion = JavaLanguageVersion . of(25 ) }
37+ toolchain {
38+ languageVersion = JavaLanguageVersion . of(25 )
39+ vendor = JvmVendorSpec . ADOPTIUM
40+ }
3841}
42+
3943tasks. withType(JavaCompile ). configureEach { options. release = 25 }
4044
4145jacoco {
Original file line number Diff line number Diff line change @@ -19,11 +19,20 @@ publishing {
1919
2020// ----------------------- Tool discovery (jdeps/jlink via toolchain) -----------------
2121def toolExecutable = { String toolName ->
22- def svc = project. extensions. getByType(org.gradle.jvm.toolchain.JavaToolchainService )
23- def launcher = svc. launcherFor(project. java. toolchain)
24- def javaHome = launcher. get(). metadata. installationPath. asFile
22+ File javaHome = null
23+ def envHome = System . getenv(' JAVA_HOME' )
24+ if (envHome) {
25+ javaHome = new File (envHome)
26+ }
27+ if (! javaHome?. exists()) {
28+ def svc = project. extensions. getByType(JavaToolchainService )
29+ def launcher = svc. launcherFor(project. java. toolchain)
30+ javaHome = launcher. get(). metadata. installationPath. asFile
31+ }
2532 def ext = OperatingSystem . current(). isWindows() ? " .exe" : " "
26- new File (javaHome, " bin/${ toolName}${ ext} " ). absolutePath
33+ def path = new File (javaHome, " bin/${ toolName}${ ext} " ). absolutePath
34+ logger. lifecycle(" [tools] Using ${ toolName} at ${ path} " )
35+ return path
2736}
2837
2938// ----------------------- Common providers/locations ---------------------------------
You can’t perform that action at this time.
0 commit comments