-
Notifications
You must be signed in to change notification settings - Fork 1.1k
How to configure a file watcher to automatically run code generator
Using the Jenny-Server
- Go to Settings -> Appearance & Behavior -> Scopes
- Create a new scope
-
- Name:
Changed component files
- Name:
-
- Pattern:
file[riderModule]:Assets/App/Features//*Component*.cs
- Pattern:
All my components are either in a SomeComponent.cs file, or in SomeFeatureComponents.cs when I'm building a feature before I cleanup the code.
- Go to Settings -> Tools -> File Watchers
- Create a new file watcher
-
- name:
Watch for component change
- name:
-
- File Type:
C#
- File Type:
-
- Scope:
Changed component files
- Scope:
-
- Program:
$ProjectFileDir$\Jenny\Jenny.exe
- Program:
-
- Arguments:
client gen
- Arguments:
-
- Working Directory:
$ProjectFileDir$
- Working Directory:
-
- Advanced options: I enabled only
Trigger watcher on external changes
- Advanced options: I enabled only
-
- Show console:
On Error
- Show console:
Don't want to have to manually start the jenny server manually?
Create a file "Jenny-Client-Gen.bat" in the project root
@echo off
pushd %~dp0
tasklist /FI "IMAGENAME eq Jenny.exe" 2>NUL | find /I /N "Jenny.exe"
if "%ERRORLEVEL%" NEQ "0" (
START CMD /K CALL "Jenny-Server.bat"
)
.\Jenny\Jenny.exe client gen
popd
Update the "Program" field of the file watcher to run this batch file instead of Jenny.exe and remove the arguments.
It will check if Jenny is running and if not, start it in a new console window that will stay opened.
Create a file "Jenny-Client-Gen.txt” in the project root
#!/bin/bash
dir="$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)"
cd $dir
ps ax | grep -v grep | grep "Jenny.exe server"
if [[ $? -ne 0 ]]; then
osascript -e "tell application \"Terminal\" to do script \"cd $dir; ./Jenny-Server;\""
sleep 3
fi
mono ./Jenny/Jenny.exe client gen
Don't forget to 'chmod +x (path to the file)/Jenny-Client-Gen.txt' to make it executable.
Update the "Program" field of the file watcher to run this file instead of Jenny.exe and remove the arguments.
It will check if Jenny is running and if not, start it in a new terminal window that will stay opened.
(feel free to contribute if you're using it)
(feel free to contribute if you're using it)
Guides: Introduction - Installation - Upgrading - FAQ - Cookbook - Contributing
Need Help? Ask a question on Discord or create an issue.
- The Basics
- Concepts
- Architecture / Patterns