On Friday, 20 February 2015 at 14:00:33 UTC, Kingsley wrote:
Hi
Just thought I would share this in case anyone else finds it
useful. I wrote a tiny utility that detects changes to D files
and then rebuilds and re-executes the main binary using dub.
I use for developing with vibe.d and other dub D project that
have an executable binary.
The code is here: https://github.com/kingsleyh/reloaded
essentially you just run dub in the root and it builds the
reloaded binary. Then you just copy that binary to the root of
your dub project and ./reloaded and then as soon as you make a
change to a D file your code will be built and executed.
You seem to especially target Vibe.d and your approach is based
on *restarting* the server. It should be possible to do even
better. Reload the server without stopping.
Basic idea: Compile your server application as a shared library.
Run a small wrapper, which uses the shared library. If a file
changes, recompile the library and load it into the wrapper.