Skip to content

Jetbrains Rider file watcher to automatically generate components from CLI

mchamplain edited this page Jul 14, 2022 · 1 revision

How to run the generator from command line:

I like to have the code generator run automatically most of the time:

From the Genesis.CLI/ folder, assuming it's next to the Unity project folder

dotnet .\Genesis.CLI.dll generate --project-path="..\MyProject" --config-file .\unity_temp_config.json --solution-path="..\MyProject\MyProject.sln"

File watcher config for Rider to automatically generate components when files are changed

I create a scope first

image

Entitas Redux Components
file:Assets/MyProject/Sources//*Component.cs||file:Assets/MyProject/Sources//*Components.cs

Then create a watcher task that monitor those files and run the generator when changed.

image

dotnet
Genesis.CLI.dll generate --verbose  --project-path="$SolutionDir$" --config-file="unity_temp_config.json" --solution-path="$SolutionPath$"
$SolutionDir$\..\Genesis.CLI\