While inotifywait is nice on Linux to rather easily enable a watch mode, this still requires that the watch script looks at the very same files as the Buma.java build script.
It would be nice if a Target object could be instructed to watch for changes of the thing it manages (typically a file or directory) and report the change.
Though this is probably only sane for targets with no dependencies, i.e. source files.
This somewhat points rather to FileState than to Target to have, say, a method .withWatch(Consumer<...> callback) providing a callback to report changes of the file or files manage by the FileState.
On the other hand it would be nice to have an api along the lines of
Targetjar=....jar.watch(()->{build.reset();build.update(jar);});
which strongly suggests that every Target has a watch() method which would distribute the callback recursively down to all dependencies.
While `inotifywait` is nice on Linux to rather easily enable a watch mode, this still requires that the watch script looks at the very same files as the Buma.java build script.
It would be nice if a `Target` object could be instructed to watch for changes of the thing it manages (typically a file or directory) and report the change.
Though this is probably only sane for targets with no dependencies, i.e. source files.
This somewhat points rather to `FileState` than to `Target` to have, say, a method `.withWatch(Consumer<...> callback)` providing a callback to report changes of the file or files manage by the `FileState`.
On the other hand it would be nice to have an api along the lines of
```java
Target jar = ....
jar.watch(() -> {
build.reset();
build.update(jar);
});
```
which strongly suggests that every `Target` has a `watch()` method which would distribute the callback recursively down to all dependencies.