Issue 50 in fabricate: Watch to auto-build

16 views
Skip to first unread message

fabr...@googlecode.com

unread,
Sep 9, 2013, 7:51:39 PM9/9/13
to fabrica...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 50 by wer...@beroux.com: Watch to auto-build
http://code.google.com/p/fabricate/issues/detail?id=50

It would be great to have WAF automatically execute the steps required when
files change.

This may allow something like SASS --watch which saves a lot of time.

The watch should allow to specify a target target so that only that is
built automatically.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

fabr...@googlecode.com

unread,
Sep 10, 2013, 7:52:24 AM9/10/13
to fabrica...@googlegroups.com

Comment #1 on issue 50 by wer...@beroux.com: Watch to auto-build
http://code.google.com/p/fabricate/issues/detail?id=50

[Watchdog](https://github.com/gorakhargosh/watchdog) seems to help a lot on
that.

Here is a script which does that so it should be easy to incorporate it in
fabricate:

import sys
import time
from watchdog.observers import Observer
from watchdog.tricks import ShellCommandTrick

if __name__ == __main__:
event_handler = ShellCommandTrick(shell_command='python build.py',
wait_for_process=True)
observer = Observer()
observer.schedule(event_handler, '.', recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()

It has a possible issue, when you touch a file it'll be recorded as a
CREATE followed right after by a MODIFY event. There should probably be a
buffer of a few milliseconds. Possibly the files could be filtered to
include only some of them but that's more optional for now.

Lex Trotman

unread,
Sep 10, 2013, 9:24:08 AM9/10/13
to fabrica...@googlegroups.com
It doesn't need to be in fabricate, you can use this in your build script to trigger fabricate


You received this message because you are subscribed to the Google Groups "fabricate users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabricate-users+unsubscribe@googlegroups.com.
To post to this group, send email to fabricate-users@googlegroups.com.
Visit this group at http://groups.google.com/group/fabricate-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages