Files
HanjaKanaMun/justfile
T
SansanandClaude Opus 5.5 9ee2eabe9a Add justfile, ols/odinfmt config, tests and Gitea workflows; drop odin.json
- justfile with build/run/check/test/release/package/fmt/clean recipes
- ols.json and odinfmt.json for neovim (ols)
- Tests for memory game rules and card animation; memory.deal and
  memory.select_card split out so logic is testable without a window
- Gitea workflows: build+test on main/develop, package and upload to the
  generic package registry on version branches
- Game changes to the executable's directory so packaged builds find assets

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 21:04:08 +02:00

44 lines
1.2 KiB
Makefile

name := "HanjaKanaMun"
build_dir := "build"
# List available recipes
default:
@just --list
# Debug build
build:
odin build . -vet -debug -out:{{name}}
# Build and run (debug)
run:
odin run . -vet -debug -out:{{name}}
# Type-check with vet, no binary
check:
odin check . -vet
# Run the test suite (single-threaded: the tests share the memory game's global state)
test:
mkdir -p {{build_dir}}
odin test tests -vet -define:ODIN_TEST_THREADS=1 -out:{{build_dir}}/tests
# Optimized build into build/, with the assets it needs at runtime
release:
mkdir -p {{build_dir}}/{{name}}
odin build . -vet -o:speed -out:{{build_dir}}/{{name}}/{{name}}
cp -R assets {{build_dir}}/{{name}}/
# Release build packed as build/<name>_<version>_<os>_<arch>.tar.gz
package version="dev": release
tar -czf {{build_dir}}/{{name}}_{{version}}_{{os()}}_{{arch()}}.tar.gz -C {{build_dir}} {{name}}
@echo "{{build_dir}}/{{name}}_{{version}}_{{os()}}_{{arch()}}.tar.gz"
# Format all Odin files with odinfmt (settings in odinfmt.json)
fmt:
odinfmt -w .
# Remove build output
clean:
if [ -d {{build_dir}} ]; then rm -r -- {{build_dir}}; fi
rm -f -- {{name}}