From 1b25c4e6cabd820a86572a6bd4df8b295a1b5039 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Mon, 23 Dec 2019 14:57:15 -0600 Subject: [PATCH] Update documentation --- all.html | 2 +- build.html | 118 +++++++++++++++++++++++++++++++------------------- build.idx | 3 +- cimport.html | 6 ++- compat.html | 2 +- paths.html | 2 +- plugin.html | 2 +- theindex.html | 10 ++++- types.html | 2 +- 9 files changed, 92 insertions(+), 55 deletions(-) diff --git a/all.html b/all.html index 3724bee..fc0f0db 100644 --- a/all.html +++ b/all.html @@ -850,7 +850,7 @@ function main() { diff --git a/build.html b/build.html index 2446361..8859919 100644 --- a/build.html +++ b/build.html @@ -836,8 +836,11 @@ function main() { title="sanitizePath(path: string; noQuote = false; sep = $'/'): string">sanitizePath
  • sleep
  • -
  • execAction
  • +
  • getCurrentNimCompiler
  • +
  • execAction
  • findExe
  • - -
    proc execAction(cmd: string; retry = 0; nostderr = false): string {...}{.
    -    raises: [OSError, Exception, IOError, Defect],
    -    tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    + +
    proc getCurrentNimCompiler(): string {...}{.raises: [], tags: [].}
    +
    + + + +
    + +
    proc execAction(cmd: string; retry = 0; die = true; cache = false; cacheKey = ""): tuple[
    +    output: string, ret: int] {...}{.raises: [IOError, ValueError, OSError, Exception, Defect], tags: [
    +    ReadEnvEffect, ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect,
    +    RootEffect].}

    Execute an external command - supported at compile time

    -

    Checks if command exits successfully before returning. If not, an error is raised.

    +

    Checks if command exits successfully before returning. If not, an error is raised. Always caches results to be used in nimsuggest or nimcheck mode.

    +

    retry - number of times command should be retried before error die = false - return on errors cache = true - cache results unless cleared with -f cacheKey - key to create unique cache entry

    -
    proc findExe(exe: string): string {...}{.raises: [], tags: [].}
    +
    proc findExe(exe: string): string {...}{.raises: [IOError, ValueError, OSError, Exception,
    +                                        Defect], tags: [ReadEnvEffect,
    +    ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect, RootEffect].}
    Find the specified executable using the which/where command - supported at compile time
    -
    proc mkDir(dir: string) {...}{.raises: [OSError, Exception, IOError, Defect, ValueError], tags: [
    -    ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc mkDir(dir: string) {...}{.raises: [IOError, ValueError, OSError, Exception, Defect], tags: [
    +    ReadDirEffect, ReadEnvEffect, ReadIOEffect, WriteIOEffect, ExecIOEffect,
    +    RootEffect].}

    Create a directory at compile time

    @@ -970,33 +985,35 @@ Find the specified executable using the
    proc cpFile(source, dest: string; move = false) {...}{.
    -    raises: [OSError, Exception, IOError, Defect, ValueError],
    -    tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    + raises: [IOError, ValueError, OSError, Exception, Defect], tags: [ReadEnvEffect, + ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect, RootEffect].}
    Copy a file from source to dest at compile time
    -
    proc mvFile(source, dest: string) {...}{.raises: [OSError, Exception, IOError, Defect,
    -                                        ValueError],
    -                                tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc mvFile(source, dest: string) {...}{.raises: [IOError, ValueError, OSError, Exception,
    +                                        Defect], tags: [ReadEnvEffect,
    +    ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect, RootEffect].}
    Move a file from source to dest at compile time
    -
    proc rmFile(source: string; dir = false) {...}{.raises: [OSError, Exception, IOError, Defect,
    -    ValueError], tags: [ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc rmFile(source: string; dir = false) {...}{.raises: [IOError, ValueError, OSError,
    +    Exception, Defect], tags: [ReadDirEffect, ReadEnvEffect, ReadIOEffect,
    +                            WriteIOEffect, ExecIOEffect, RootEffect].}
    Remove a file or pattern at compile time
    -
    proc rmDir(dir: string) {...}{.raises: [OSError, Exception, IOError, Defect, ValueError], tags: [
    -    ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc rmDir(dir: string) {...}{.raises: [IOError, ValueError, OSError, Exception, Defect], tags: [
    +    ReadDirEffect, ReadEnvEffect, ReadIOEffect, WriteIOEffect, ExecIOEffect,
    +    RootEffect].}
    Remove a directory or pattern at compile time @@ -1004,8 +1021,8 @@ Remove a directory or pattern at compile time
    proc getProjectCacheDir(name: string; forceClean = true): string {...}{.
    -    raises: [OSError, Exception, IOError, Defect, ValueError], tags: [ReadEnvEffect,
    -    ReadIOEffect, ReadDirEffect, ExecIOEffect, RootEffect].}
    + raises: [IOError, ValueError, OSError, Exception, Defect], tags: [ReadEnvEffect, + ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect, RootEffect].}

    Get a cache directory where all nimterop artifacts can be stored

    @@ -1022,24 +1039,27 @@ Remove a directory or pattern at compile time
    -
    proc extractZip(zipfile, outdir: string) {...}{.raises: [OSError, Exception, IOError, Defect,
    -    ValueError], tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc extractZip(zipfile, outdir: string) {...}{.raises: [IOError, ValueError, OSError,
    +    Exception, Defect], tags: [ReadEnvEffect, ReadIOEffect, ReadDirEffect,
    +                            WriteIOEffect, ExecIOEffect, RootEffect].}
    Extract a zip file using powershell on Windows and unzip on other systems to the specified output directory
    -
    proc extractTar(tarfile, outdir: string) {...}{.raises: [ValueError, OSError, Exception,
    -    IOError, Defect], tags: [ExecIOEffect, ReadIOEffect, RootEffect, ReadDirEffect].}
    +
    proc extractTar(tarfile, outdir: string) {...}{.raises: [IOError, ValueError, OSError,
    +    Exception, Defect], tags: [ReadEnvEffect, ReadIOEffect, ReadDirEffect,
    +                            WriteIOEffect, ExecIOEffect, RootEffect].}
    Extract a tar file using tar, 7z or 7za to the specified output directory
    -
    proc downloadUrl(url, outdir: string) {...}{.raises: [OSError, Exception, IOError, Defect,
    -    ValueError], tags: [ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc downloadUrl(url, outdir: string) {...}{.raises: [IOError, ValueError, OSError,
    +    Exception, Defect], tags: [ReadDirEffect, ReadEnvEffect, ReadIOEffect,
    +                            WriteIOEffect, ExecIOEffect, RootEffect].}

    Download a file using curl or wget (or powershell on Windows) to the specified directory

    @@ -1048,16 +1068,18 @@ Extract a tar file using tar -
    proc gitReset(outdir: string) {...}{.raises: [ValueError, OSError, Exception, IOError, Defect],
    -                             tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc gitReset(outdir: string) {...}{.raises: [ValueError, IOError, OSError, Exception, Defect], tags: [
    +    ReadEnvEffect, ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect,
    +    RootEffect].}
    Hard reset the git repository at the specified directory
    -
    proc gitCheckout(file, outdir: string) {...}{.raises: [ValueError, OSError, Exception,
    -    IOError, Defect], tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc gitCheckout(file, outdir: string) {...}{.raises: [ValueError, IOError, OSError,
    +    Exception, Defect], tags: [ReadEnvEffect, ReadIOEffect, ReadDirEffect,
    +                            WriteIOEffect, ExecIOEffect, RootEffect].}

    Checkout the specified file in the git repository at outdir

    @@ -1067,8 +1089,8 @@ Hard reset the git repository at the specified directory
    proc gitPull(url: string; outdir = ""; plist = ""; checkout = "") {...}{.
    -    raises: [ValueError, OSError, Exception, IOError, Defect], tags: [ReadDirEffect,
    -    ExecIOEffect, ReadIOEffect, RootEffect, WriteIOEffect].}
    + raises: [ValueError, IOError, OSError, Exception, Defect], tags: [ReadDirEffect, + ReadEnvEffect, ReadIOEffect, WriteIOEffect, ExecIOEffect, RootEffect].}

    Pull the specified git repository to the output directory

    @@ -1079,7 +1101,8 @@ Hard reset the git repository at the specified directory
    proc findFile(file: string; dir: string; recurse = true; first = false; regex = false): string {...}{.
    -    raises: [ValueError], tags: [].}
    + raises: [ValueError, IOError, OSError, Exception, Defect], tags: [ReadEnvEffect, + ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect, RootEffect].}

    Find the file in the specified directory

    @@ -1104,7 +1127,8 @@ Hard reset the git repository at the specified directory
    proc linkLibs(names: openArray[string]; staticLink = true): string {...}{.
    -    raises: [ValueError], tags: [].}
    + raises: [ValueError, IOError, OSError, Exception, Defect], tags: [ReadEnvEffect, + ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect, RootEffect].}

    Create linker flags for specified libraries

    @@ -1114,8 +1138,8 @@ Hard reset the git repository at the specified directory
    proc configure(path, check: string; flags = "") {...}{.
    -    raises: [OSError, Exception, IOError, Defect, ValueError],
    -    tags: [ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    + raises: [IOError, ValueError, OSError, Exception, Defect], tags: [ReadDirEffect, + ReadEnvEffect, ReadIOEffect, WriteIOEffect, ExecIOEffect, RootEffect].}

    Run the GNU configure command to generate all Makefiles or other build scripts in the specified path

    @@ -1172,8 +1196,9 @@ Set a cmake directive
    -
    proc cmake(path, check, flags: string) {...}{.raises: [OSError, Exception, IOError, Defect,
    -    ValueError], tags: [ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc cmake(path, check, flags: string) {...}{.raises: [IOError, ValueError, OSError,
    +    Exception, Defect], tags: [ReadDirEffect, ReadEnvEffect, ReadIOEffect,
    +                            WriteIOEffect, ExecIOEffect, RootEffect].}

    Run the cmake command to generate all Makefiles or other build scripts in the specified path

    @@ -1185,8 +1210,8 @@ Set a cmake directive
    proc make(path, check: string; flags = ""; regex = false) {...}{.
    -    raises: [ValueError, OSError, Exception, IOError, Defect],
    -    tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    + raises: [ValueError, IOError, OSError, Exception, Defect], tags: [ReadEnvEffect, + ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect, RootEffect].}

    Run the make command to build all binaries in the specified path

    @@ -1205,15 +1230,18 @@ Set a cmake directive
    -
    proc getGccPaths(mode = "c"): seq[string] {...}{.raises: [ValueError], tags: [ReadEnvEffect].}
    +
    proc getGccPaths(mode = "c"): seq[string] {...}{.raises: [IOError, ValueError, OSError,
    +    Exception, Defect], tags: [ReadEnvEffect, ReadIOEffect, ReadDirEffect,
    +                            WriteIOEffect, ExecIOEffect, RootEffect].}
    -
    proc getGccLibPaths(mode = "c"): seq[string] {...}{.raises: [ValueError],
    -    tags: [ReadEnvEffect].}
    +
    proc getGccLibPaths(mode = "c"): seq[string] {...}{.
    +    raises: [IOError, ValueError, OSError, Exception, Defect], tags: [ReadEnvEffect,
    +    ReadIOEffect, ReadDirEffect, WriteIOEffect, ExecIOEffect, RootEffect].}
    @@ -1288,7 +1316,7 @@ Check if -d:xxx is se diff --git a/build.idx b/build.idx index 8b67066..dbed146 100644 --- a/build.idx +++ b/build.idx @@ -1,6 +1,7 @@ sanitizePath build.html#sanitizePath,string build: sanitizePath(path: string; noQuote = false; sep = $'/'): string sleep build.html#sleep,int build: sleep(milsecs: int) -execAction build.html#execAction,string,int build: execAction(cmd: string; retry = 0; nostderr = false): string +getCurrentNimCompiler build.html#getCurrentNimCompiler build: getCurrentNimCompiler(): string +execAction build.html#execAction,string,int,string build: execAction(cmd: string; retry = 0; die = true; cache = false; cacheKey = ""): tuple[\n output: string, ret: int] findExe build.html#findExe,string build: findExe(exe: string): string mkDir build.html#mkDir,string build: mkDir(dir: string) cpFile build.html#cpFile,string,string build: cpFile(source, dest: string; move = false) diff --git a/cimport.html b/cimport.html index cf968cd..bbb467a 100644 --- a/cimport.html +++ b/cimport.html @@ -948,7 +948,9 @@ Add directory dir to
    -
    proc cAddStdDir(mode = "c") {...}{.compileTime, raises: [ValueError], tags: [ReadEnvEffect].}
    +
    proc cAddStdDir(mode = "c") {...}{.compileTime, raises: [IOError, ValueError, OSError,
    +    Exception, Defect], tags: [ReadEnvEffect, ReadIOEffect, ReadDirEffect,
    +                            WriteIOEffect, ExecIOEffect, RootEffect].}
    Add the standard c [default] or cpp include paths to search path used in calls to cSearchPath() @@ -1102,7 +1104,7 @@ Add an include directory that is forwarded to the C/C++ preprocessor if called w diff --git a/compat.html b/compat.html index 31badcf..16d342c 100644 --- a/compat.html +++ b/compat.html @@ -859,7 +859,7 @@ function main() { diff --git a/paths.html b/paths.html index 6f7f98c..d6558a0 100644 --- a/paths.html +++ b/paths.html @@ -917,7 +917,7 @@ function main() { diff --git a/plugin.html b/plugin.html index ed37afd..9b3a724 100644 --- a/plugin.html +++ b/plugin.html @@ -927,7 +927,7 @@ function main() { diff --git a/theindex.html b/theindex.html index e37add3..fd650e2 100644 --- a/theindex.html +++ b/theindex.html @@ -900,7 +900,9 @@ function main() {
    execAction:
    • build: execAction(cmd: string; retry = 0; nostderr = false): string
    • + data-doc-search-tag="build: execAction(cmd: string; retry = 0; die = true; cache = false; cacheKey = ""): tuple[ + output: string, ret: int]" href="build.html#execAction%2Cstring%2Cint%2Cstring">build: execAction(cmd: string; retry = 0; die = true; cache = false; cacheKey = ""): tuple[ + output: string, ret: int]
    extractTar:
    +
    getCurrentNimCompiler:
    getGccLibPaths:
    • build: getGccLibPaths(mode = "c"): seq[string]
    • @@ -1077,7 +1083,7 @@ function main() { diff --git a/types.html b/types.html index 06628f3..39dc132 100644 --- a/types.html +++ b/types.html @@ -924,7 +924,7 @@ function main() {