summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2016-12-23 12:26:28 +0100
committerAraq <rumpf_a@web.de>2016-12-23 12:26:28 +0100
commit77d5d0cdfe5ac1dfbf590beb10d0ab1d84b14b3a (patch)
tree55f2aa7ee398a3f6f5bc879d101810def8792f6c
parent0daca5c46301420df86460c61bfe60951956bb94 (diff)
downloadNim-77d5d0cdfe5ac1dfbf590beb10d0ab1d84b14b3a.tar.gz
NimScript: prepare for future Nimble improvements; should be completely compatible with old and upcoming Nimble versions
-rw-r--r--lib/system/nimscript.nim44
1 files changed, 23 insertions, 21 deletions
diff --git a/lib/system/nimscript.nim b/lib/system/nimscript.nim
index 29466c34d..f675a9472 100644
--- a/lib/system/nimscript.nim
+++ b/lib/system/nimscript.nim
@@ -293,26 +293,28 @@ template task*(name: untyped; description: string; body: untyped): untyped =
     setCommand "nop"
     `name Task`()
 
-var
-  packageName* = ""    ## Nimble support: Set this to the package name. It
-                       ## is usually not required to do that, nims' filename is
-                       ## the default.
-  version*: string     ## Nimble support: The package's version.
-  author*: string      ## Nimble support: The package's author.
-  description*: string ## Nimble support: The package's description.
-  license*: string     ## Nimble support: The package's license.
-  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*,
-    installExt*, bin*: seq[string] = @[] ## Nimble metadata.
-  requiresData*: seq[string] = @[] ## Exposes the list of requirements for read
-                                   ## and write accesses.
-
-proc requires*(deps: varargs[string]) =
-  ## Nimble support: Call this to set the list of requirements of your Nimble
-  ## package.
-  for d in deps: requiresData.add(d)
+when not defined(nimble):
+  # nimble has its own implementation for these things.
+  var
+    packageName* = ""    ## Nimble support: Set this to the package name. It
+                         ## is usually not required to do that, nims' filename is
+                         ## the default.
+    version*: string     ## Nimble support: The package's version.
+    author*: string      ## Nimble support: The package's author.
+    description*: string ## Nimble support: The package's description.
+    license*: string     ## Nimble support: The package's license.
+    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*,
+      installExt*, bin*: seq[string] = @[] ## Nimble metadata.
+    requiresData*: seq[string] = @[] ## Exposes the list of requirements for read
+                                     ## and write accesses.
+
+  proc requires*(deps: varargs[string]) =
+    ## Nimble support: Call this to set the list of requirements of your Nimble
+    ## package.
+    for d in deps: requiresData.add(d)
 
 {.pop.}