diff options
author | Nils Gillmann <ng0@n0.is> | 2018-09-16 13:03:18 +0000 |
---|---|---|
committer | Nils Gillmann <ng0@n0.is> | 2018-09-16 13:03:18 +0000 |
commit | 0e7306fbee8b807b7fcae7f6e9026dcb0322cc2d (patch) | |
tree | bfdae9efc576c391409e82343a0fa3a7e5541553 | |
parent | 7d823653440bab68cd51cbfd27d667fb7a932fa5 (diff) | |
download | gnunet-nim-0e7306fbee8b807b7fcae7f6e9026dcb0322cc2d.tar.gz gnunet-nim-0e7306fbee8b807b7fcae7f6e9026dcb0322cc2d.zip |
Add nakefile, nim.cfg, and ignore more things
Signed-off-by: Nils Gillmann <ng0@n0.is>
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | nakefile.nim | 46 | ||||
-rw-r--r-- | nim.cfg | 1 |
3 files changed, 52 insertions, 2 deletions
@@ -1,7 +1,10 @@ | |||
1 | /gnunet_nim | 1 | /gnunet_nim |
2 | /nimcache | 2 | nimcache |
3 | /gnunet_data_home | 3 | /gnunet_data_home |
4 | /gnunet_home | 4 | /gnunet_home |
5 | /otherpeer_data_home | 5 | /otherpeer_data_home |
6 | /otherpeer_home | 6 | /otherpeer_home |
7 | 7 | examples/groupchat | |
8 | *.pretty.nim | ||
9 | *.backup | ||
10 | nakefile | ||
diff --git a/nakefile.nim b/nakefile.nim new file mode 100644 index 0000000..2621ac2 --- /dev/null +++ b/nakefile.nim | |||
@@ -0,0 +1,46 @@ | |||
1 | import nake | ||
2 | import sequtils | ||
3 | |||
4 | proc build() = | ||
5 | let | ||
6 | dest = "examples/groupchat" | ||
7 | src = dest & ".nim" | ||
8 | |||
9 | if dest.needsRefresh(src): | ||
10 | direSilentShell(src & " -> " & dest, | ||
11 | nimExe, "c", "--verbosity:2", | ||
12 | src) | ||
13 | |||
14 | # Not fully functional or functional at all right now: | ||
15 | proc buildDocs() = | ||
16 | for name in ["asynccadet", "gnunet_application", | ||
17 | "gnunet_cadet_service", "gnunet_common", | ||
18 | "gnunet_configuration_lib", "gnunet_crypto_lib", | ||
19 | "gnunet_mq_lib", "gnunet_protocols", | ||
20 | "gnunet_scheduler_lib", "gnunet_time_lib", | ||
21 | "gnunet_types", "gnunet_utils"]: | ||
22 | let | ||
23 | dest = name & ".html" | ||
24 | src = name & ".nim" | ||
25 | |||
26 | if dest.needsRefresh(src): | ||
27 | direSilentShell(src & " -> " & dest, | ||
28 | nimExe, "doc2", "--verbosity:0", "--index:on", src) | ||
29 | |||
30 | for rstSrc in walkFiles("*.rst"): | ||
31 | let rstDest = rstSrc.changeFileExt(".html") | ||
32 | if not rstDest.needsRefresh(rstSrc): continue | ||
33 | direSilentShell(rstSrc & " -> " & rstDest, | ||
34 | nimExe & " rst2html --verbosity:0 --index:on -o:" & | ||
35 | rstDest & " " & rstSrc) | ||
36 | |||
37 | direSilentShell("Building theindex.html", nimExe, "buildIndex .") | ||
38 | |||
39 | |||
40 | task "docs", "generate user documentation for nake API and local rst files": | ||
41 | buildDocs() | ||
42 | echo "Finished generating docs" | ||
43 | |||
44 | task "build", "build binaries and examples": | ||
45 | build() | ||
46 | echo "Finished build" | ||
@@ -0,0 +1 @@ | |||
-p:"$HOME/.guix-profile/lib/nim/packages" | |||