Skip to content

Godot Version Support

frontrider edited this page Oct 30, 2023 · 3 revisions

Unsupported Godot version.

IF there is a godot version not supported by the plugin, then here are the steps to create the needed configuration.

Godot Version

The io.github.frontrider.godle.dsl.versioning.GodotVersion class is the one that stores the version information. It is currently only available for linux, windows and mac as realistically those are the platforms where Gradle can run.

os and bit are from the io.github.frontrider.godle package, they store the current os and the current platform. Those 2 are also set by default so don't set them unless you want to force a different setting.

This is "where" the version can be found.

//For the official build.
GodotVersion(
    os = os,
    bit = bit,
    version = "3.5.1",
    cacheName = "v%version%-%bit%",
    linuxDownloadURL = "https://downloads.tuxfamily.org/godotengine/%version%/Godot_v%version%-stable_x11.%bit%.zip",
    windowsDownloadURL = "https://downloads.tuxfamily.org/godotengine/%version%/Godot_v%version%-stable_win%bit%.exe.zip",
    macDownloadURL = "https://downloads.tuxfamily.org/godotengine/%version%/Godot_v%version%-stable_osx.universal.zip",
    linuxBinary = "Godot_v%version%-stable_x11.%bit%",
    windowsBinary = "Godot_v%version%-stable_win%bit%.exe",
    macBinary = "Godot_v%version%-stable_osx.universal", 
    majorVersion = versionAsGodot3(),

    //you can also configure the default download and exec tasks from the version configuration. 
    downloadTask = {},
    execTask = {},
)

The execTask helper is internally used by the kotlin/jvm version configuration to set the java home.

Major Version

For a new major version you also need to create the settings as well, If it does not exist. The default one will always be called versionAsGodot<VersionNumber>(), eg versionAsGodot3(),versionAsGodot4().

This file is used to store the different command line flags required to run godot in certain modes.

This tells the addon "how" to use the binary.

MajorVersion(
    editorFlag = "--editor",
    projectPathFlag ="--path",
    exportBindingsFlags = listOf("--gdnative-generate-json-api"),
    debugFlag = "--debug",
    headlessFlag = "--no-windows",
    versionFlag = "--version",
    scriptFlag = "--script",
)

majorVersion is included to bridge the API differences between major releases, while still allowing for "arbitrary" versions to be set in the version field.

Clone this wiki locally