1
0
Fork
You've already forked BuildMachine
0

API for a watch mode #2

Open
opened 2024年03月06日 15:53:10 +01:00 by harald · 0 comments

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.
Sign in to join this conversation.
No Branch/Tag specified
main
pages
v-3.2.0
v-3.1.0
v-2.0.2
v-2.0.1
v-2.0.0
v-1.2.2
v-1.1.0
No labels
Kind
Bug
Kind
Feature
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harald/BuildMachine#2
Reference in a new issue
harald/BuildMachine
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?