Moved Nimble-specific Nimscript definitions to nimscriptapi module.
* Moved package info reading procedures to a packageparser module. This is to prevent recu rsive dependencies between nimscriptsupport and packageinfo modules. * Passed the Options object to all procedures which read package info (necessary for nimscriptsupport module, to find the path of the nimscriptapi module) * Introduced an ``isInstalled`` field to the ``PackageInfo`` type. This is a bug fix for g etRealDir: it no longer uses the ``src`` field in the path it returns for installed packag es' PackageInfo objects. * Improved error reporting from NimScript evaluator. * Renamed compiler/options import to ``compiler_options`` in ``nimscriptsupport`` module. * Backward compatibility for .babel packages in getNameVersion proc. * Introduced a getInstalledPkgsMin procedure which does not read package info, but only pr ovides minimal info instead.
This commit is contained in:
parent
84f371982b
commit
ca99ad7d21
9 changed files with 426 additions and 300 deletions
30
src/nimblepkg/nimscriptapi.nim
Normal file
30
src/nimblepkg/nimscriptapi.nim
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Copyright (C) Dominik Picheta. All rights reserved.
|
||||
# BSD License. Look at license.txt for more info.
|
||||
|
||||
## This module is implicitly imported in NimScript .nimble files.
|
||||
|
||||
var
|
||||
packageName* = "" ## Set this to the package name. It
|
||||
## is usually not required to do that, nims' filename is
|
||||
## the default.
|
||||
version*: string ## The package's version.
|
||||
author*: string ## The package's author.
|
||||
description*: string ## The package's description.
|
||||
license*: string ## The package's license.
|
||||
srcdir*: string ## The package's source directory.
|
||||
binDir*: string ## The package's binary directory.
|
||||
backend*: string ## The package's backend.
|
||||
|
||||
skipDirs*, skipFiles*, skipExt*, installDirs*, installFiles*,
|
||||
installExt*, bin*: seq[string] = @[] ## Nimble metadata.
|
||||
requiresData*: seq[string] = @[] ## The package's dependencies.
|
||||
|
||||
proc requires*(deps: varargs[string]) =
|
||||
## Call this to set the list of requirements of your Nimble
|
||||
## package.
|
||||
for d in deps: requiresData.add(d)
|
||||
|
||||
template builtin = discard
|
||||
|
||||
proc getPkgDir*(): string =
|
||||
builtin
|
||||
Loading…
Add table
Add a link
Reference in a new issue