diff --git a/src/nimble.nim b/src/nimble.nim index e584839..2a7c04f 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -7,7 +7,7 @@ import httpclient, parseopt, os, strutils, osproc, pegs, tables, parseutils, from sequtils import toSeq import nimblepkg/packageinfo, nimblepkg/version, nimblepkg/tools, - nimblepkg/download, nimblepkg/config, nimblepkg/nimbletypes, + nimblepkg/download, nimblepkg/config, nimblepkg/common, nimblepkg/publish, nimblepkg/options, nimblepkg/packageparser import nimblepkg/nimscriptsupport @@ -30,9 +30,6 @@ else: proc GetVersionExA*(VersionInformation: var OSVERSIONINFO): WINBOOL{.stdcall, dynlib: "kernel32", importc: "GetVersionExA".} -const - nimbleVersion = "0.7.8" - proc writeVersion() = echo("nimble v$# compiled at $# $#" % [nimbleVersion, CompileDate, CompileTime]) diff --git a/src/nimblepkg/common.nim b/src/nimblepkg/common.nim new file mode 100644 index 0000000..1348d58 --- /dev/null +++ b/src/nimblepkg/common.nim @@ -0,0 +1,40 @@ +# BSD License. Look at license.txt for more info. +# +# Various miscellaneous common types reside here, to avoid problems with +# recursive imports + +when not defined(nimscript): + import sets + + import version + export version.NimbleError + + type + BuildFailed* = object of NimbleError + + PackageInfo* = object + mypath*: string ## The path of this .nimble file + isNimScript*: bool ## Determines if this pkg info was read from a nims file + isMinimal*: bool + isInstalled*: bool ## Determines if the pkg this info belongs to is installed + postHooks*: HashSet[string] ## Useful to know so that Nimble doesn't execHook unnecessarily + preHooks*: HashSet[string] + name*: string + version*: string + author*: string + description*: string + license*: string + skipDirs*: seq[string] + skipFiles*: seq[string] + skipExt*: seq[string] + installDirs*: seq[string] + installFiles*: seq[string] + installExt*: seq[string] + requires*: seq[PkgTuple] + bin*: seq[string] + binDir*: string + srcDir*: string + backend*: string + +const + nimbleVersion* = "0.7.8" diff --git a/src/nimblepkg/config.nim b/src/nimblepkg/config.nim index d9852fd..dbd1513 100644 --- a/src/nimblepkg/config.nim +++ b/src/nimblepkg/config.nim @@ -2,7 +2,7 @@ # BSD License. Look at license.txt for more info. import parsecfg, streams, strutils, os, tables, Uri -import tools, version, nimbletypes +import tools, version, common type Config* = object diff --git a/src/nimblepkg/download.nim b/src/nimblepkg/download.nim index 5e6506f..5ce58b4 100644 --- a/src/nimblepkg/download.nim +++ b/src/nimblepkg/download.nim @@ -3,7 +3,7 @@ import parseutils, os, osproc, strutils, tables, pegs -import packageinfo, packageparser, version, tools, nimbletypes, options +import packageinfo, packageparser, version, tools, common, options type DownloadMethod* {.pure.} = enum diff --git a/src/nimblepkg/nimbletypes.nim b/src/nimblepkg/nimbletypes.nim deleted file mode 100644 index ae6ec47..0000000 --- a/src/nimblepkg/nimbletypes.nim +++ /dev/null @@ -1,36 +0,0 @@ -# BSD License. Look at license.txt for more info. -# -# Various miscellaneous common types reside here, to avoid problems with -# recursive imports - -import sets - -import version -export version.NimbleError - -type - BuildFailed* = object of NimbleError - - PackageInfo* = object - mypath*: string ## The path of this .nimble file - isNimScript*: bool ## Determines if this pkg info was read from a nims file - isMinimal*: bool - isInstalled*: bool ## Determines if the pkg this info belongs to is installed - postHooks*: HashSet[string] ## Useful to know so that Nimble doesn't execHook unnecessarily - preHooks*: HashSet[string] - name*: string - version*: string - author*: string - description*: string - license*: string - skipDirs*: seq[string] - skipFiles*: seq[string] - skipExt*: seq[string] - installDirs*: seq[string] - installFiles*: seq[string] - installExt*: seq[string] - requires*: seq[PkgTuple] - bin*: seq[string] - binDir*: string - srcDir*: string - backend*: string diff --git a/src/nimblepkg/nimscriptsupport.nim b/src/nimblepkg/nimscriptsupport.nim index 7f5e699..c5e7b4a 100644 --- a/src/nimblepkg/nimscriptsupport.nim +++ b/src/nimblepkg/nimscriptsupport.nim @@ -15,7 +15,7 @@ from compiler/idents import getIdent from compiler/astalgo import strTableGet import compiler/options as compiler_options -import nimbletypes, version, options, packageinfo +import common, version, options, packageinfo import os, strutils, strtabs, times, osproc, sets type diff --git a/src/nimblepkg/options.nim b/src/nimblepkg/options.nim index e67815c..f1e9805 100644 --- a/src/nimblepkg/options.nim +++ b/src/nimblepkg/options.nim @@ -4,7 +4,7 @@ import json, strutils, os, parseopt, strtabs, uri, tables from httpclient import Proxy, newProxy -import config, version, tools, nimbletypes +import config, version, tools, common type Options* = object diff --git a/src/nimblepkg/packageinfo.nim b/src/nimblepkg/packageinfo.nim index 5c07957..4fe5cca 100644 --- a/src/nimblepkg/packageinfo.nim +++ b/src/nimblepkg/packageinfo.nim @@ -1,7 +1,7 @@ # Copyright (C) Dominik Picheta. All rights reserved. # BSD License. Look at license.txt for more info. import parsecfg, json, streams, strutils, parseutils, os, sets, tables -import version, tools, nimbletypes, options +import version, tools, common, options type Package* = object diff --git a/src/nimblepkg/packageparser.nim b/src/nimblepkg/packageparser.nim index cf641a9..c6259d4 100644 --- a/src/nimblepkg/packageparser.nim +++ b/src/nimblepkg/packageparser.nim @@ -1,7 +1,7 @@ # Copyright (C) Dominik Picheta. All rights reserved. # BSD License. Look at license.txt for more info. import parsecfg, json, streams, strutils, parseutils, os, tables -import version, tools, nimbletypes, nimscriptsupport, options, packageinfo +import version, tools, common, nimscriptsupport, options, packageinfo ## Contains procedures for parsing .nimble files. Moved here from ``packageinfo`` ## because it depends on ``nimscriptsupport`` (``nimscriptsupport`` also diff --git a/src/nimblepkg/publish.nim b/src/nimblepkg/publish.nim index e831c9d..e7fa836 100644 --- a/src/nimblepkg/publish.nim +++ b/src/nimblepkg/publish.nim @@ -5,7 +5,7 @@ ## nim-lang/packages automatically. import httpclient, base64, strutils, rdstdin, json, os, browsers, times, uri -import tools, nimbletypes +import tools, common type Auth = object diff --git a/src/nimblepkg/tools.nim b/src/nimblepkg/tools.nim index 7e2989f..65c6f8d 100644 --- a/src/nimblepkg/tools.nim +++ b/src/nimblepkg/tools.nim @@ -3,7 +3,7 @@ # # Various miscellaneous utility functions reside here. import osproc, pegs, strutils, os, uri, sets, json, parseutils -import version, packageinfo, nimbletypes +import version, packageinfo, common proc extractBin(cmd: string): string = if cmd[0] == '"':