-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Motivation
Currently, the build system is opaque. It's split across Rust, Python, GitHub Actions, etc and a lot of code is outdated/irrelevant or buggy.
Additionally, to even get to the point where you can launch a project, you have to clone a minimum of three repositories and symlink them all over the place.
We need a build system where everything is in one place, so that it's maintainable, and which handles all these tasks for us.
Just
Although any build system would work, I think just makes the most sense -- it's lightweight, lets us use any language we want for tasks, has VSCode integration, and is easy to read and setup. It's also particularly "rusty".
File Structure
public: Public plugin assets like gdscript,.gdextension, UI scenes, etc that we need shipped directly with the pluginrust: Rust code to produce our plugin DLLeditor: Patchwork's C++ editor module necessary to build with Godotbuild: Our entire build environment, ignored by git.plugin: The built plugin folder, intended to be dropped in a project'saddonsnative/*: The various binaries generated by Rust
godot: A copy of the Godot repository with Patchwork's editor module linked insidemoddable-platformer/threadbare: A testing project we can easily dev on
Environment Variables/Config
PATCHWORK_DEBUG: Whether we should build Patchwork (Rust) in debug modeGODOT_DEBUG: Whether we should build Godot in debug mode{PROJECT}_URL: Git URL of the project (threadbareormoddable-platformer)
Tasks
Setup:
make_build_dir: Makes./build
Cloning:
acquire_project {PROJECT}: Acquirebuild/{PROJECT}- Requires:
make_build_dir - Clone if it doesn't exist already
- Requires:
acquire_godot: Acquirebuild/godot- Requires:
make_build_dir - Clone if it doesn't exist already
- Requires:
Linking:
link_project {PROJECT}: Symlinkbuild/{PROJECT}/addons/patchwork <=> build/plugin- Requires:
acquire_project - Allows us to launch a project while developing the plugin
- Requires:
link_editor: Symlinkbuild/godot/modules/patchwork_editor <=> editor- Requires:
acquire_godot - Allows us to build Godot with the editor module linked in
- Requires:
link_publicSymlinkbuild/plugin/public <=> public- Requires:
make_build_dir - Ensures our public assets like gdscript, images, etc are included in the plugin build folder
- Requires:
Building:
build_godot: If necessary, build Godot with Patchwork with Scons- Requires:
link_editor
- Requires:
build_patchwork: Runcargo buildon Rust
Plugin setup:
make_plugin_dir: Makebuild/plugin- Requires:
make_build_dir
- Requires:
copy_libs: Find Rust-generated DLLs and copy them tobuild/plugin/native- Requires:
make_plugin_dir - Replaces
build.rs,post_build.rs
- Requires:
sign_libs: Sign Mac .dylib files and whatever else (? idk how this works yet)- Requires:
copy_libs - Hopefully replaces some github workflows(?)
- Requires:
sign_plugin {SERVER_URL}: Generatebuild/plugin/plugin.cfgand insert the correct server URL inpatchwork.cfg- Requires:
make_plugin_dir - Replaces update_version.py.
- Requires:
Cleaning:
clean_godot: Clean Godot (scons --clean)clean_patchwork: Clean Patchwork (cargo clean)clean_plugin: Clean plugin DLLs etcclean_project {PROJECT}: Reset a project state (reset the repository, remove .patchwork, and reset patchwork.config)clean: Clean everything
Running:
launch_project <PROJECT> [-u <SERVER_URL>]: Launch project with built Godot- Requires:
build_patchwork,build_godot,link_{PROJECT},sign_plugin
- Requires:
Targets
- Launch
threadbare/moddable-platformer(debug/release) for the current platform - Hot-reload Rust plugin
Stretch Goals
- When starting a project in dev mode, also start up a local instance of
automerge-rust-sync-serverand automatically link it inplugin.cfg. - Use Rust watcher to hot-reload rust plugin automatically
- Generate releases using this build system (i.e. move as much code from github actions to running these tasks as possible), since release issues are annoying to debug in general.
- Automatically edit
README.mdupon release
- Automatically edit
Metadata
Metadata
Assignees
Labels
No labels