Skip to content
Frontrider edited this page Dec 22, 2022 · 9 revisions

Basic configuration

Godle first and foremost allows you to link the version of godot

//use the named extension 
godle{
    
}
//configure by class
configure<GodleExtension>{
    //creates a blank project in the godotRoot folder.
    createBlankProject = true
    //configure the godot version of your choice.
    version = `kotlin-jvm`("0.5.1-3.5.1")
    
    //alternative kotlin handle for groovy.
    version = kotlinJvm("0.5.1-3.5.1")
    //the kotlin compat's second argument can disable automatic JVM detection.
    //it will first check the current runtime's jvm (as in the JVM that runs gradle right now), then the environment.
    `asKotlin-jvm`("0.5.1-3.5.1",false) 
    asGodot("3.5.1") 
    asMono("3.5.1") 
    //the folder where the godot project is located.
    godotRoot.set(project.rootDir)
    //environment variables for godot
    env["my_key"] = "my_value"
    env("my_key","my_value")
}

createBlankProject will not erase any existing project files.

Godle will also generate a set of shell/batch scripts to launch the game and the editor without having to run gradle by hand, can be used to set shortcuts.

Default Tasks

Godle provides a number of tasks to work with.

  • cleanGodotAddons: cleans the addon folder, so godle can download it again.
  • godleAddons: installs the currently configured addons
  • godotDownload: downloads the currently configured version of Godot.
  • godotEditor: runs the editor in the godotRoot folder (configured on the extension). It will open any projects in that folder.
  • godotVersion: prints the current Godot version.
  • godotRunGame: runs the game in the godotRoot folder (configured on the extension). It will open any projects in that folder.

Godle can produce gdnative/gdextension bindings for the currently downloaded godot version.

On Godot 3, use the godotGenerateBindingJson task to produce the json under build/generated/godot/api.json.

On Godot 4, use the godotGenerateBindingJson task to produce the json under build/generated/godot/extension_api.json, or the godotGenerateGDExtensionInterface to create godot's header file under build/generated/godot/gdnative_interface.h

This can be used to organize binding generation for that version of Godot.

Clone this wiki locally