diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | appveyor.yml | 9 | ||||
| -rw-r--r-- | src/nimgen/c2nim.nim | 2 | ||||
| -rw-r--r-- | src/nimgen/external.nim | 2 | ||||
| -rw-r--r-- | src/nimgen/file.nim | 2 | ||||
| -rw-r--r-- | src/nimgen/runcfg.nim | 15 |
6 files changed, 20 insertions, 12 deletions
@@ -106,7 +106,7 @@ List of all directories or files to exclude from all parsing. If an entry here m _[n.prepare]_ -The following keys can be used to prepare dependencies such as downloading ZIP files, cloning Git repositories, etc. Multiple entries are possible by appending any .string to the key. E.g. download.file1. -win, -lin and -osx can be used for OS specific tasks. E.g. download-win +The following keys can be used to prepare dependencies such as downloading ZIP files, cloning Git repositories, etc. Multiple entries are possible by appending any .string to the key. E.g. download.file1. -win, -lin and -mac/osx can be used for OS specific tasks. E.g. download-win, execute-lin,mac.unique1 ```download``` = url to download to the output directory. ZIP files are automatically extracted. Files are not redownloaded if already present but re-extracted diff --git a/appveyor.yml b/appveyor.yml index bcadda0..6b5f682 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -79,11 +79,12 @@ for: NIM_URL: https://nim-lang.org/download/nim-0.18.0.tar.xz NIM_ARCHIVE: nim-0.18.0.tar.xz NIM_VERSION: nim-0.18.0 + BASE_DIR: /home/appveyor/projects install: - sudo apt -qq update - sudo apt -qq install --yes python-pygments libssh2-1-dev libgcrypt20-dev libgpg-error-dev - - cd ~/projects + - cd $BASE_DIR - if [ ! -e $NIM_ARCHIVE ]; then curl -s -o $NIM_ARCHIVE $NIM_URL; fi - tar xJf $NIM_ARCHIVE - cd $NIM_VERSION @@ -91,15 +92,15 @@ for: - bin/nim c -d:release koch - ./koch boot -d:release - ./koch nimble -d:release - - export PATH=~/projects/$NIM_VERSION/bin:~/.nimble/bin:$PATH - - cd ~/projects/nimgen + - export PATH=$BASE_DIR/$NIM_VERSION/bin:~/.nimble/bin:$PATH + - cd $BASE_DIR/nimgen on_finish: - zip -r -q buildlogs-lin.zip ~/.nimble/pkgs - appveyor PushArtifact buildlogs-lin.zip cache: - - ~/projects/nim-0.18.0.tar.xz + - /home/appveyor/projects/nim-0.18.0.tar.xz build_script: - nimble install -y diff --git a/src/nimgen/c2nim.nim b/src/nimgen/c2nim.nim index 28a3b77..4d721b4 100644 --- a/src/nimgen/c2nim.nim +++ b/src/nimgen/c2nim.nim @@ -48,7 +48,7 @@ proc c2nim*(fl, outfile: string, c2nimConfig: c2nimConfigObj) = for prag in c2nimConfig.pragma: outpragma &= "{." & prag & ".}\n" - let fname = file.splitFile().name.replace(re"[\.\-]", "_") + let fname = file.splitFile().name.multiReplace([(".", "_"), ("-", "_")]) if c2nimConfig.dynlib.len() != 0: let diff --git a/src/nimgen/external.nim b/src/nimgen/external.nim index 2c4a12e..79426f6 100644 --- a/src/nimgen/external.nim +++ b/src/nimgen/external.nim @@ -147,7 +147,7 @@ proc runCtags*(file: string): string = fdata = "" for line in fps.splitLines(): - var spl = line.split(re"\t") + var spl = line.split('\t') if spl.len() > 4: if spl[0] != "main" and spl[3] != "member": var fn = "" diff --git a/src/nimgen/file.nim b/src/nimgen/file.nim index b46f7be..d78c692 100644 --- a/src/nimgen/file.nim +++ b/src/nimgen/file.nim @@ -6,7 +6,7 @@ import globals # File loction proc getNimout*(file: string, rename=true): string = - result = file.splitFile().name.replace(re"[\-\.]", "_") & ".nim" + result = file.splitFile().name.multiReplace([("-", "_"), (".", "_")]) & ".nim" if gOutput != "": result = gOutput & "/" & result diff --git a/src/nimgen/runcfg.nim b/src/nimgen/runcfg.nim index a641150..105cede 100644 --- a/src/nimgen/runcfg.nim +++ b/src/nimgen/runcfg.nim @@ -11,12 +11,15 @@ proc getKey(ukey: string): tuple[key: string, val: bool] = if kv.len() == 1: kv.add("") - if (kv[1] == "") or - (kv[1] == "win" and defined(Windows)) or - (kv[1] == "lin" and defined(Linux)) or - (kv[1] == "osx" and defined(MacOSX)): + if kv[1] == "": return (kv[0], true) + for ostyp in kv[1].split(","): + if (ostyp == "win" and defined(Windows)) or + (ostyp == "lin" and defined(Linux)) or + ((ostyp == "osx" or ostyp == "mac") and defined(MacOSX)): + return (kv[0], true) + return (kv[0], false) proc runFile*(file: string, cfgin: OrderedTableRef = newOrderedTable[string, string]()) = @@ -55,6 +58,10 @@ proc runFile*(file: string, cfgin: OrderedTableRef = newOrderedTable[string, str echo "Creating " & file createDir(file.splitPath().head) writeFile(file, cfg[act]) + if file in gExcludes: + gExcludes.delete(gExcludes.find(file)) + sfile = search(file) + gDoneRecursive.add(sfile) elif action in @["prepend", "append", "replace", "comment", "rename", "compile", "dynlib", "pragma", "pipe"] and sfile != "": |
