NimScript: prepare for future Nimble improvements; should be completely compatible with old and upcoming Nimble versions

This commit is contained in:
Araq 2016-12-23 12:26:28 +01:00
commit 77d5d0cdfe

View file

@ -293,26 +293,28 @@ template task*(name: untyped; description: string; body: untyped): untyped =
setCommand "nop" setCommand "nop"
`name Task`() `name Task`()
var when not defined(nimble):
packageName* = "" ## Nimble support: Set this to the package name. It # nimble has its own implementation for these things.
## is usually not required to do that, nims' filename is var
## the default. packageName* = "" ## Nimble support: Set this to the package name. It
version*: string ## Nimble support: The package's version. ## is usually not required to do that, nims' filename is
author*: string ## Nimble support: The package's author. ## the default.
description*: string ## Nimble support: The package's description. version*: string ## Nimble support: The package's version.
license*: string ## Nimble support: The package's license. author*: string ## Nimble support: The package's author.
srcDir*: string ## Nimble support: The package's source directory. description*: string ## Nimble support: The package's description.
binDir*: string ## Nimble support: The package's binary directory. license*: string ## Nimble support: The package's license.
backend*: string ## Nimble support: The package's backend. srcDir*: string ## Nimble support: The package's source directory.
binDir*: string ## Nimble support: The package's binary directory.
backend*: string ## Nimble support: The package's backend.
skipDirs*, skipFiles*, skipExt*, installDirs*, installFiles*, skipDirs*, skipFiles*, skipExt*, installDirs*, installFiles*,
installExt*, bin*: seq[string] = @[] ## Nimble metadata. installExt*, bin*: seq[string] = @[] ## Nimble metadata.
requiresData*: seq[string] = @[] ## Exposes the list of requirements for read requiresData*: seq[string] = @[] ## Exposes the list of requirements for read
## and write accesses. ## and write accesses.
proc requires*(deps: varargs[string]) = proc requires*(deps: varargs[string]) =
## Nimble support: Call this to set the list of requirements of your Nimble ## Nimble support: Call this to set the list of requirements of your Nimble
## package. ## package.
for d in deps: requiresData.add(d) for d in deps: requiresData.add(d)
{.pop.} {.pop.}