-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make download task not rely on an outdated gradle plugin.
update kotlin version definition to be compatible with Godot kotlin/jvm for godot 4. make the kotlin module rely on the jvm from the project's toolchain.
- Loading branch information
1 parent
4ccd10a
commit af85e3c
Showing
7 changed files
with
54 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ class Godle : Plugin<Project> { | |
|
||
project.initBaseGodot() | ||
project.ignores() | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.github.frontrider.godle.dsl.versioning | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaPluginExtension | ||
import org.gradle.process.ExecSpec | ||
|
||
fun setupJVM(detectJVM: Boolean = true, exec:ExecSpec) { | ||
//the exec task detects the current JVM | ||
if (detectJVM) { | ||
if (jvmPath != null) { | ||
exec.environment("JAVA_HOME", jvmPath!!) | ||
return | ||
} | ||
println("attempting to detect jvm!") | ||
|
||
//attempt to determine the current JVM's path and use it. | ||
val command = ProcessHandle.current() | ||
.info() | ||
.command() | ||
|
||
if (command.isPresent) { | ||
val javaHome = command.get().removeSuffix("/bin/java") | ||
println("jvm found at $javaHome") | ||
//determine from the process itself, this is the most secure variant | ||
exec.environment("JAVA_HOME", javaHome) | ||
jvmPath = javaHome | ||
} else { | ||
//determine from an environment variable, will most likely be set, but it may not be the correct one. | ||
val javaHome = System.getProperty("java.home") | ||
if (javaHome != null) { | ||
println("jvm found at $javaHome") | ||
exec.environment("JAVA_HOME", javaHome) | ||
jvmPath = javaHome | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters