Various optimisations to PackageInfo reading and bug fixes.

* PackageInfo objects are now cached because NimScript evaluation is expensive.
* before/after hooks now return `true` by default.
* Bugfix: when hooks weren't found Nimble would still think that a hook told it
  to skip an action.
* PackageInfo now includes info about which hooks are defined to prevent
  unnecessary execution of those hooks.
* Probably more.
This commit is contained in:
Dominik Picheta 2015-12-30 19:43:20 +00:00
commit 42ef358459
8 changed files with 47 additions and 20 deletions

View file

@ -27,12 +27,13 @@ proc requires*(deps: varargs[string]) =
template before*(action: untyped, body: untyped): untyped =
## Defines a block of code which is evaluated before ``action`` is executed.
proc `action Before`*(): bool =
result = false
result = true
body
template after*(action: untyped, body: untyped): untyped =
## Defines a block of code which is evaluated after ``action`` is executed.
proc `action After`*(): bool =
result = true
body
template builtin = discard