preparations for Nimble NimScript integrations; minor cleanups
This commit is contained in:
parent
10a7830ba2
commit
9659540b18
7 changed files with 74 additions and 6 deletions
|
|
@ -150,3 +150,30 @@ template task*(name: untyped; description: string; body: untyped): untyped =
|
|||
elif cmd ==? astToStr(name):
|
||||
setCommand "nop"
|
||||
`name Task`()
|
||||
|
||||
type
|
||||
VersionReq* = distinct string ## Describes a version requirement.
|
||||
|
||||
template v*(name: string{lit}): VersionReq = VersionReq(name)
|
||||
template special*(name: string): VersionReq = VersionReq(name)
|
||||
template `<`*(v: VersionReq): VersionReq = VersionReq("<" & string(v))
|
||||
template `<=`*(v: VersionReq): VersionReq = VersionReq("<=" & string(v))
|
||||
template `>`*(v: VersionReq): VersionReq = VersionReq(">" & string(v))
|
||||
template `>=`*(v: VersionReq): VersionReq = VersionReq(">=" & string(v))
|
||||
template `&`*(a, b: VersionReq): VersionReq =
|
||||
VersionReq(string(a) & " & " & string(b))
|
||||
|
||||
const
|
||||
anyVersion* = VersionReq("*")
|
||||
|
||||
var
|
||||
packageName* = ""
|
||||
version*, author*, description*, license*, srcdir*,
|
||||
binDir*, backend*: string
|
||||
|
||||
skipDirs*, skipFiles*, skipExt*, installDirs*, installFiles*,
|
||||
installExt*, bin*: seq[string]
|
||||
requiresData*: seq[(string, VersionReq)]
|
||||
|
||||
proc requires*(name: string; v: VersionReq) =
|
||||
requiresData.add((name, v))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue