-
Notifications
You must be signed in to change notification settings - Fork 2
/
snorlogue.nimble
74 lines (61 loc) · 2.36 KB
/
snorlogue.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Package
version = "1.0.4"
author = "Philipp Doerner"
description = "A Prologue extension. Provides an admin environment for your prologue server making use of norm."
license = "MIT"
srcDir = "src"
# Dependencies
requires "nim >= 1.6.8"
requires "norm >= 2.5.0"
requires "prologue >= 0.6.0"
requires "nimja >= 0.8.4"
requires "lowdb >= 0.2.0"
requires "HTest >= 0.1.0"
skipDirs = @["example"]
task run_example, "NOTE TO USER: Remember to copy the resources folder into your project from which you are compiling! - Compiles and runs the snorlogue example":
exec("cp -r ./src/snorlogue/resources ./src/example")
--run
--deepcopy:on
--define:normDebug
--define:ssl
--styleCheck:usages
--define:sqlite
--outdir:"src/example"
setCommand "c", "src/example/example.nim"
task docs, "Write the package docs":
exec "nim doc --verbosity:0 --define:sqlite --project --index:on " &
"--git.url:[email protected]:PhilippMDoerner/Snorlogue.git" &
"--git.commit:master " &
"-o:docs/apidocs " &
"src/snorlogue.nim"
task cl, "Compiles the lib":
--deepcopy:on
--define:normDebug
--define:ssl
--styleCheck:usages
--define:sqlite
--path:"/home/philipp/dev/snorlogue"
--define:basePath:"/home/philipp/dev/snorlogue"
setCommand "c", "src/snorlogue.nim"
task nimidocs, "Compiles the nimibook docs":
rmDir "docs/bookCompiled"
exec "cp -r ./src/snorlogue/resources ./docs/book"
exec "nimble install -y nimib@#head nimibook@#head"
exec "nim c -d:release --mm:refc -d:sqlite nbook.nim"
exec "./nbook -d:sqlite --mm:refc update"
exec "./nbook -d:sqlite --mm:refc build"
task apis, "docs only for api":
exec "nim doc --verbosity:0 --warnings:off --project --index:on -d:sqlite " &
"--git.url:https://github.com/PhilippMDoerner/Snorlogue " &
"--git.commit:main " &
"-o:docs/plugin " &
"src/snorlogue.nim"
exec "nim buildIndex -o:docs/plugin/index.html docs/plugin"
task postgresTests, "Run containerized postgres tests":
echo staticExec "sudo docker image rm snorlogue"
exec "sudo docker-compose run --rm tests-postgres"
task sqliteTests, "Run containerized sqlite tests":
echo staticExec "sudo docker image rm snorlogue"
exec "sudo docker-compose run --rm tests-sqlite"
task pretty, "Runs nimpretty to format the code in the project":
exec """find . -name "*.nim" -exec nimpretty --maxLineLen:100 --indent:2 {} +"""