-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add needsRefresh for multiple targets #65
base: master
Are you sure you want to change the base?
Conversation
@yglukhov Does this look good to you? |
nakelib.nim
Outdated
@@ -193,6 +193,38 @@ template withDir*(dir: string; body: untyped): untyped = | |||
cd(curDir) | |||
|
|||
|
|||
proc needsRefresh*(targets: seq[string], src: varargs[string]): bool {.raises: [OSError].} = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd better make both args openarray
, for maximum flexibility.
nakelib.nim
Outdated
var minTargetTime: float = -1 | ||
for target in targets: | ||
try: | ||
let targetTime = toSeconds(getLastModificationTime(target)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like with toSeconds
we lose precision that might be important. Can we do better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably? I just copied the existing implementation (trying not to change too many things at once)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yglukhov Are you thinking maybe toWinTime()
?
For the case when a build step produces multiple targets. For my case, using
tsc
to compile TypeScript files to JavaScript.