diff --git a/src/cs/production/Assetyard/README.md b/src/cs/production/Assetyard/README.md index 081c593..b1bcd95 100644 --- a/src/cs/production/Assetyard/README.md +++ b/src/cs/production/Assetyard/README.md @@ -27,7 +27,7 @@ assetyard cook # cook every asset once, for example before dotnet publish assetyard watch # cook every asset, then each one again when you save it, until Ctrl+C ``` -Put the files you edit in `Assets/Raw/`, next to your game's `.csproj`. They're cooked into `Assets/Cooked/`, with the same folders and file names. Commit `Assets/Raw`, and add `Assets/Cooked/` to `.gitignore`. Run it from the repository's root or the project's folder: it cooks every `Assets/Raw` it finds. +Put the files you edit in `Assets/Raw/`, next to your game's `.csproj`. They're cooked into `Assets/Cooked/`, with the same folders and file names. Commit `Assets/Raw`, and add `**/Assets/Cooked/` to `.gitignore` (with `**/`, so it matches in a project's folder, not only at the repository's root). Run it from the repository's root or the project's folder: it cooks every `Assets/Raw` it finds. ## Shaders diff --git a/src/cs/production/Templates/shared/.gitignore b/src/cs/production/Templates/shared/.gitignore index 728681b..f8e9cb4 100644 --- a/src/cs/production/Templates/shared/.gitignore +++ b/src/cs/production/Templates/shared/.gitignore @@ -8,5 +8,6 @@ *.user .DS_Store -# Assets that Assetyard cooks from Assets/Raw (`dotnet assetyard cook`) -Assets/Cooked/ +# Assets that Assetyard cooks from Assets/Raw (`dotnet assetyard cook`), in any project's folder. `**/` is needed: a pattern with a +# slash in it, such as Assets/Cooked/, only matches at the repository's root +**/Assets/Cooked/ diff --git a/src/cs/tests/Consumers/test.sh b/src/cs/tests/Consumers/test.sh index c19e290..ee9a674 100755 --- a/src/cs/tests/Consumers/test.sh +++ b/src/cs/tests/Consumers/test.sh @@ -207,6 +207,9 @@ mkdir -p "$work/TestGame/src/cs/TestGame/Assets/Raw/Text" echo "Hello from a raw asset." > "$work/TestGame/src/cs/TestGame/Assets/Raw/Text/raw.txt" (cd "$work/TestGame" && export DOTNET_CLI_HOME="$work/cli-home" && dotnet tool restore && dotnet assetyard cook) [[ -f "$work/TestGame/src/cs/TestGame/Assets/Cooked/Text/raw.txt" ]] || { echo "The bl-game template's Assetyard didn't cook Assets/Raw" >&2; exit 1; } +# The template's .gitignore keeps cooked assets out of Git, in the project's folder too, not only at the repository's root +(cd "$work/TestGame" && git init -q && git check-ignore -q src/cs/TestGame/Assets/Cooked/Text/raw.txt) || + { echo "The bl-game template's .gitignore doesn't ignore src/cs/TestGame/Assets/Cooked/" >&2; exit 1; } # The game template publishes and runs. Its game runs until its window is closed, so check that it's still running after a few # seconds (it opened its window and is drawing frames), then stop it