Best way to depend on file timestamps?

35 views
Skip to first unread message

Bruce Eckel

unread,
Aug 16, 2013, 12:38:30 PM8/16/13
to pa...@googlegroups.com
If I want to write a rule that depends on a file timestamp being up to date compared with another file timestamp, is there a way to do that with @needs? Or is it something that you just do using path inside the rule itself? (that is, the first thing inside the rule is to check timestamps  and if the target is newer than the dependency, just return).

I haven't been able to find any reference or examples talking about this.

jhermann

unread,
Aug 23, 2013, 4:06:22 PM8/23/13
to pa...@googlegroups.com
On Friday, August 16, 2013 6:38:30 PM UTC+2, Bruce Eckel wrote:
If I want to write a rule that depends on a file timestamp being up to date compared with another file timestamp, is there a way to do that with @needs?

You can certainly do that with normal logic within the task, but the common use-cases should probably get some syntactic sugar, like “@updates(target, srcfiles)”, “@unless(bool)”, or similar.

The first one would read rather naturally I think → @task @updates(…) def foo(): …
Reply all
Reply to author
Forward
0 new messages