aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Gillmann <ng0@n0.is>2018-09-16 13:03:18 +0000
committerNils Gillmann <ng0@n0.is>2018-09-16 13:03:18 +0000
commit0e7306fbee8b807b7fcae7f6e9026dcb0322cc2d (patch)
treebfdae9efc576c391409e82343a0fa3a7e5541553
parent7d823653440bab68cd51cbfd27d667fb7a932fa5 (diff)
downloadgnunet-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--.gitignore7
-rw-r--r--nakefile.nim46
-rw-r--r--nim.cfg1
3 files changed, 52 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 388c089..b4c2599 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,10 @@
1/gnunet_nim 1/gnunet_nim
2/nimcache 2nimcache
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 7examples/groupchat
8*.pretty.nim
9*.backup
10nakefile
diff --git a/nakefile.nim b/nakefile.nim
new file mode 100644
index 0000000..2621ac2
--- /dev/null
+++ b/nakefile.nim
@@ -0,0 +1,46 @@
1import nake
2import sequtils
3
4proc 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:
15proc 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
40task "docs", "generate user documentation for nake API and local rst files":
41 buildDocs()
42 echo "Finished generating docs"
43
44task "build", "build binaries and examples":
45 build()
46 echo "Finished build"
diff --git a/nim.cfg b/nim.cfg
new file mode 100644
index 0000000..1938d27
--- /dev/null
+++ b/nim.cfg
@@ -0,0 +1 @@
-p:"$HOME/.guix-profile/lib/nim/packages"