aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2018-07-13 00:19:50 -0500
committerGanesh Viswanathan <dev@genotrance.com>2018-07-13 00:19:50 -0500
commite46d3b2332d439cda073a34947cdaa803926e948 (patch)
tree223a22686d6f1b98548fcdf060bf4bd922affb62
parent7d60e2eea78169d7237594f6ab77ed02c968acc3 (diff)
downloadnimgen-e46d3b2332d439cda073a34947cdaa803926e948.tar.gz
nimgen-e46d3b2332d439cda073a34947cdaa803926e948.zip
Implement #7 - [n.sourcefile] section, add nimclipboard
-rw-r--r--README.md6
-rw-r--r--appveyor.yml2
-rw-r--r--src/nimgen/runcfg.nim13
-rw-r--r--tests/nimgentest.nims10
4 files changed, 21 insertions, 10 deletions
diff --git a/README.md b/README.md
index 8b4be53..1d7b574 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,8 @@ To see examples of nimgen in action check out the following wrappers:-
* git sparse checkout
* [nimbigwig](https://github.com/genotrance/nimbigwig) - libbigWig wrapper: [docs](http://nimgen.genotrance.com/nimbigwig)
* git checkout
+ * [nimclipboard](https://github.com/genotrance/nimclipboard) - libclipboard wrapper: [docs](http://nimgen.genotrance.com/nimclipboard)
+ * git checkout
* [nimfuzz](https://github.com/genotrance/nimfuzz) - fts_fuzzy_match wrapper: [docs](http://nimgen.genotrance.com/nimfuzz)
* download header file
* [nimkerberos](https://github.com/genotrance/nimkerberos) - WinKerberos wrapper: [docs](http://nimgen.genotrance.com/nimkerberos)
@@ -134,6 +136,10 @@ File wildcards such as *.nim, ssl*.h, etc. can be used to perform tasks across a
```wildcard``` = pattern to match against. All keys following the wildcard declaration will apply to matched files
+_[n.sourcefile]_
+
+This section allows selection of multiple sourcefiles without requiring a detailed section for each file. Each specific file can be listed one line at a time and file wildcards can be used to include multiple source files. E.g. `$output/include/*/h`. `[n.wildcard]` definitions can be used to perform common operations on these source files if required.
+
_[sourcefile]_
The following keys apply to library source code and help with generating the .nim files. -win, -lin and -osx can be used for OS specific tasks. E.g. dynlib-win, pragma-win
diff --git a/appveyor.yml b/appveyor.yml
index a54b7ce..bcadda0 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -61,6 +61,8 @@ for:
on_finish:
- 7z a -r buildlogs-win.zip %USERPROFILE%\.nimble\pkgs
- appveyor PushArtifact buildlogs-win.zip
+ - 7z a -r nimgen-docs.zip %BASE_DIR%\nimgen\web
+ - appveyor PushArtifact nimgen-docs.zip
cache:
- c:\projects\i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z
diff --git a/src/nimgen/runcfg.nim b/src/nimgen/runcfg.nim
index 96e067e..cc48c01 100644
--- a/src/nimgen/runcfg.nim
+++ b/src/nimgen/runcfg.nim
@@ -19,15 +19,15 @@ proc getKey(ukey: string): tuple[key: string, val: bool] =
return (kv[0], false)
-proc runFile*(file: string, cfgin: OrderedTableRef) =
+proc runFile*(file: string, cfgin: OrderedTableRef = newOrderedTable[string, string]()) =
var
cfg = cfgin
sfile = search(file)
for pattern in gWildcards.keys():
- var match: RegexMatch
+ var m: RegexMatch
let pat = pattern.replace(".", "\\.").replace("*", ".*").replace("?", ".?")
- if file.find(toPattern(pat), match):
+ if file.find(toPattern(pat), m):
echo "Appending " & file & " " & pattern
for key in gWildcards[pattern].keys():
cfg[key & "." & pattern] = gWildcards[pattern][key]
@@ -224,7 +224,12 @@ proc runCfg*(cfg: string) =
"n.prepare", "n.wildcard", "n.post"]:
continue
- runFile(file, gConfig[file])
+ if file == "n.sourcefile":
+ for pattern in gConfig["n.sourcefile"].keys():
+ for file in walkFiles(pattern.addEnv):
+ runFile(file)
+ else:
+ runFile(file, gConfig[file])
if gConfig.hasKey("n.post"):
for post in gConfig["n.post"].keys():
diff --git a/tests/nimgentest.nims b/tests/nimgentest.nims
index f5136c6..9c3e2d7 100644
--- a/tests/nimgentest.nims
+++ b/tests/nimgentest.nims
@@ -1,11 +1,9 @@
-import distros
-import ospaths
-import strutils
+import distros, ospaths, strutils
var
- full = false
- comps = @["libsvm", "nim7z", "nimarchive", "nimbass", "nimbigwig", "nimfuzz",
- "nimpcre", "nimrax", "nimssl", "nimssh2"]
+ full = true
+ comps = @["libsvm", "nim7z", "nimarchive", "nimbass", "nimbigwig", "nimclipboard",
+ "nimfuzz", "nimpcre", "nimrax", "nimssl", "nimssh2"]
if detectOs(Windows):
comps.add("nimkerberos")