With --on-update=do-nothing, we need to know when the process is done
before we can spawn a new one, but we never actually used to truly check
the process, only the presence or absence of a spawned process. That
process may have already completed, but because we don't wait on it when
in do-nothing mode, there is no opportunity to notice this.
So now we either actually check the completion status of the process (on
Windows), or we expose the `done` mutex value on demand (Unix).
Essentially this adds a way to check the completion status of the
process without blocking (modulo a mutex lock on unix).
Fixes#200
That has a number of advantages:
- #193 the build.rs is only run for the CLI, so the Windows manifest is
not embedded in the library anymore, opening it up for downstreams.
- it sets the stage for decoupling the version numbers of the CLI and
library, to have the library increase its major more often, while the
CLI retains compatibility further… that is, to have both follow semver
- it removes the CLI-only dependencies from the library
- it makes compilation a bit faster as compiling the library and the
CLI's other dependencies can happen in parallel
One major disadvantage:
- installing via cargo changes from watchexec to watchexec-cli. Most
installs are from prebuilt and from packages, but that's still a
potential stumble.
And of course, the CLI APIs in the library are gone (they were already
deprecated, though).
We also take this opportunity to get rid of the clear_screen code and
use our new clearscreen library. #99#171#185