A robust "batteries-included" template for building Godot 4.6 games using Rust (GDExtension).
This project uses a custom build system written in Rust (cargo xtask) to handle the entire pipeline: downloading the engine, compiling code, creating project files, and exporting the final game.
├── game/ # The Godot Project
│ ├── bin/ # Compiled GDExtension binaries (auto-generated)
│ └── project.godot
├── rust/ # Rust Source Code
│ ├── src/ # Your Gameplay Crates
│ └── xtask/ # The Build System Automation
└── builds/ # Final Exported Games (auto-created)
Prerequisites
- Rust & Cargo: Install Rust
- Git
Run the setup command to automatically download Godot 4.6 and the matching Export Templates for your OS. This ensures everyone on the team uses the exact same engine version.
cargo xtask setupArtifacts are stored in .godot_bin/ (ignored by git).
To compile the Rust code, copy the libraries to the game project, and open the Godot Editor:
cargo xtask editorTo compile and immediately launch the game (without the editor):
cargo xtask runTo build the game in Release mode and export a standalone executable:
cargo xtask packageThe output will be found in the builds/ directory.
The xtask system handles the following automations:
- Version Control: Downloads the specific Godot version defined in rust/xtask/src/main.rs.
- OS Compatibility: Automatically handles paths and permissions for Windows, macOS, and Linux.
- GDExtension: Generates the .gdextension configuration file automatically.
- Bootstrap: If project.godot or main.tscn are missing, it generates minimal versions so you can start coding immediately.
- Export: Generates a default export_presets.cfg if one is missing.
See LICENSE for details.