Skip to content

Commit 08931f0

Browse files
committed
build fixes
1 parent b5002ef commit 08931f0

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

de.peeeq.wurstscript/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ application {
3434
version = "1.8.1.0"
3535

3636
java {
37-
toolchain { languageVersion = JavaLanguageVersion.of(25) }
37+
toolchain {
38+
languageVersion = JavaLanguageVersion.of(25)
39+
vendor = JvmVendorSpec.ADOPTIUM
40+
}
3841
}
42+
3943
tasks.withType(JavaCompile).configureEach { options.release = 25 }
4044

4145
jacoco {

de.peeeq.wurstscript/deploy.gradle

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@ publishing {
1919

2020
// ----------------------- Tool discovery (jdeps/jlink via toolchain) -----------------
2121
def 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 ---------------------------------

0 commit comments

Comments
 (0)