Skip to content
0.2.0-dev Download ZIP
105 lines ·6.4 KB Raw
1set shell := ["bash", "-euo", "pipefail", "-c"]
2
3scons := "uvx --python 3.14 --from scons==4.10.1 scons"
4engine_dir := justfile_directory() / "Engine"
5engine_profile := justfile_directory() / "engine.py"
6nuget_feed := justfile_directory() / ".cache/godot/nuget"
7editor_bin := engine_dir / "bin/godot.linuxbsd.editor.double.x86_64.mono"
8solution := justfile_directory() / "EvilEngine.slnx"
9user_data := env("XDG_DATA_HOME", home_directory() / ".local/share") / "godot/app_userdata/Evil Engine"
10
11build_memory := env("EVIL_BUILD_MEMORY", "8G")
12test_memory := env("EVIL_TEST_MEMORY", "8G")
13capped := "systemd-run --user --wait --pipe --collect -p MemorySwapMax=0 -p OOMPolicy=continue --same-dir -E PATH -E HOME $(compgen -e | grep -E '^(EVIL_|DOTNET_|MSBUILD|XDG_|STEAM)' | sed 's/^/-E /')"
14
15export MSBUILDDISABLENODEREUSE := "1"
16export DOTNET_CLI_USE_MSBUILD_SERVER := "0"
17export CCACHE_DIR := env("XDG_CACHE_HOME", home_directory() / ".cache") / "evil-engine/ccache"
18export CCACHE_MAXSIZE := "30G"
19
20import? 'internal.just'
21
22[private]
23default:
24 @just --list
25
26# Build the fork's double-precision .NET editor, generate its C# glue and push GodotSharp and Godot.NET.Sdk to the local NuGet feed
27[linux]
28godot: ccache-dir compiledb
29 {{scons}} -C "{{engine_dir}}" profile="{{engine_profile}}" target=editor debug_symbols=yes separate_debug_symbols=yes -j"$(nproc)"
30 "{{editor_bin}}" --headless --generate-mono-glue "{{engine_dir}}/modules/mono/glue"
31 mkdir -p "{{nuget_feed}}"
32 uv run --no-project --python 3.14 python "{{engine_dir}}/modules/mono/build_scripts/build_assemblies.py" --godot-output-dir="{{engine_dir}}/bin" --godot-platform=linuxbsd --precision=double --push-nupkgs-local="{{nuget_feed}}"
33
34# Write Engine/compile_commands.json for CLion with the same options as just godot, without compiling anything
35[linux]
36compiledb:
37 {{scons}} -C "{{engine_dir}}" profile="{{engine_profile}}" target=editor debug_symbols=yes separate_debug_symbols=yes compiledb_gen_only=yes c_compiler_launcher= cpp_compiler_launcher=
38
39# Open the fork's editor on the Godot project, or its project manager until there is one
40[linux]
41editor *args:
42 if [ -f Godot/project.godot ]; then "{{editor_bin}}" --path Godot --editor {{args}}; else "{{editor_bin}}" --project-manager {{args}}; fi
43
44# Build the game's C# and run it straight into its main menu without the editor, passing any Godot arguments on
45[linux]
46[positional-arguments]
47launch *args:
48 @dotnet build "Godot/Evil Engine.csproj" -v q --nologo
49 "{{editor_bin}}" --path Godot "$@"
50
51# Build every C# project in the root solution: the game, the libraries, the adapter folders in .build/adapters and the mounts inspector
52build:
53 {{capped}} -p MemoryMax={{build_memory}} dotnet build "{{solution}}" -v q --nologo
54
55# Run the root solution's tests, reading a real Garry's Mod install too when EVIL_GMOD points at one, under an EVIL_TEST_MEMORY cap (8G by default)
56[positional-arguments]
57test *args:
58 {{capped}} -p MemoryMax={{test_memory}} dotnet test --solution "{{solution}}" "$@"
59
60# Export the Blender models, write the PNG and JPEG images the format tests read, dump the fork's humanoid profile they check theirs against, and write the music tests' library and FLAC files with ffmpeg, flac and lame
61fixtures:
62 blender -b --factory-startup --python Libraries/Tests/EvilEngine.Formats.Tests/Fixtures/make_fixtures.py -- Libraries/Tests/EvilEngine.Formats.Tests/Fixtures
63 uv run --no-project --with pillow python -I Libraries/Tests/EvilEngine.Formats.Tests/Fixtures/make_images.py Libraries/Tests/EvilEngine.Formats.Tests/Fixtures/Images
64 "{{editor_bin}}" --headless --script Libraries/Tests/EvilEngine.Formats.Tests/Fixtures/Humanoids/dump_profile.gd -- Libraries/Tests/EvilEngine.Formats.Tests/Fixtures/Humanoids/profile.json
65 Libraries/Tests/EvilEngine.Music.Tests/Fixtures/make_music.sh Libraries/Tests/EvilEngine.Music.Tests/Fixtures
66
67# Probe a location through the built adapters and print its mounts, or every pointer in user://mounts/ when none is given
68[positional-arguments]
69mounts *args: build
70 dotnet run --no-build --project Libraries/Tools/EvilEngine.Inspector -- --adapters .build/adapters --pointers "{{user_data}}/mounts" "$@"
71
72# Render a map through the engine's world builder to a PNG from its spawn or --at=x,y,z --look=pitch,yaw, or each line of a --shots file of 'name x y z pitch yaw fov' into an --out folder, with --exposure=<scale> to hold the tonemap scale
73[linux]
74[positional-arguments]
75map-shot map *args:
76 dotnet build "Godot/Evil Engine.csproj" -v q --nologo
77 "{{editor_bin}}" --path Godot res://Client/World/MapShot.tscn -- --map="$1" "${@:2}"
78
79# Walk the movement check's routes headless with the engine's own controller on Jolt, or only --route=<name>, failing on any route that doesn't come within its radius of its end, or with --sweep=<runs> (--seed, --seconds, --walk, --map, --watch=<run>, --trace) sprint a body in random directions from the map's spawns and count its hops and stalls
80[linux]
81[positional-arguments]
82movement-check *args:
83 dotnet build "Godot/Evil Engine.csproj" -v q --nologo
84 {{capped}} -q -p MemoryMax={{test_memory}} "{{editor_bin}}" --headless --path Godot res://Client/World/MovementCheck.tscn -- "$@"
85
86# Name the surface under a ray and a dropped box's contact on --map's (gm_construct by default) triangles of each of --surfaces (grass by default) headless through the Jolt world, failing on any the map's collider doesn't report
87[linux]
88[positional-arguments]
89surface-check *args:
90 dotnet build "Godot/Evil Engine.csproj" -v q --nologo
91 {{capped}} -q -p MemoryMax={{test_memory}} "{{editor_bin}}" --headless --path Godot res://Client/World/SurfaceCheck.tscn -- "$@"
92
93# Time a map's start the way Start runs it, with vsync on, in a fresh game each run: each stage, the world build's waits on the render thread and its first frame, under an EVIL_TEST_MEMORY cap
94[linux]
95map-bench map="gmod:gm_construct" runs="3":
96 @dotnet build "Godot/Evil Engine.csproj" -v q --nologo
97 @for run in $(seq {{runs}}); do {{capped}} -q -p MemoryMax={{test_memory}} -E DISPLAY -E WAYLAND_DISPLAY "{{editor_bin}}" --path Godot res://Client/World/MapShot.tscn -- --map={{quote(map)}} --bench=1 --size=1600x900 2>&1 | grep -E '^bench |FAILED|No map record'; done
98
99# Show the engine build's ccache hit rate and size
100ccache:
101 @ccache --show-stats
102
103[private]
104ccache-dir:
105 @[ -d "$CCACHE_DIR" ] || { mkdir -p "$(dirname "$CCACHE_DIR")" && { btrfs subvolume create "$CCACHE_DIR" >/dev/null 2>&1 || mkdir "$CCACHE_DIR"; }; }