-
Notifications
You must be signed in to change notification settings - Fork 6
/
nimler.nimble
138 lines (114 loc) · 4.01 KB
/
nimler.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
mode = ScriptMode.Silent
version = "4.6.0"
author = "wltsmrz"
description = "Erlang/Elixir NIFs"
license = "MIT"
skipDirs = @["tests", "docs", "examples"]
skipFiles = @["README.md"]
installDirs = @["nimler", "scripts"]
installFiles = @["nimler.nim"]
requires "nim >= 1.2.0"
proc configTest() =
if getEnv("NIMLER_BUILD_RELEASE") == "1":
--define:release
if getEnv("NIMLER_BUILD_ARM64") == "1":
--gcc.exe:"aarch64-linux-gnu-gcc"
--gcc.linkerexe:"aarch64-linux-gnu-ld"
--cpu:arm64
--os:linux
task test, "dummy":
quit(0)
task build_all, "build":
exec("nimble build_init_api")
exec("nimble build_dirty_nif")
exec("nimble build_integration")
exec("nimble build_codec")
exec("nimble build_resource")
exec("nimble build_init_resource")
exec("nimble build_timeslice")
exec("nimble build_message")
exec("nimble build_positional")
task test_all, "run tests":
exec("elixir test_all.exs")
task build_init_api, "build nif":
configTest()
switch("out", "tests/init_api/nif.so")
switch("define", "nimlerWrapperLoadInfo=123")
setCommand("compile", "tests/init_api/nif")
task test_init_api, "run test":
exec("elixir -r tests/init_api/NimlerWrapper.ex tests/init_api/test.exs")
task build_integration, "build nif":
configTest()
switch("out", "tests/integration/nif.so")
setCommand("compile", "tests/integration/nif")
task test_integration, "run test":
exec("elixir -r tests/integration/NimlerWrapper.ex tests/integration/test.exs")
task build_codec, "build nif":
configTest()
switch("out", "tests/codec/nif.so")
setCommand("compile", "tests/codec/nif")
task test_codec, "run test":
exec("elixir -r tests/codec/NimlerWrapper.ex tests/codec/test.exs")
task build_resource, "build nif":
configTest()
switch("out", "tests/resource/nif.so")
setCommand("compile", "tests/resource/nif")
task test_resource, "run test":
exec("elixir -r tests/resource/NimlerWrapper.ex tests/resource/test.exs")
task build_init_resource, "build nif":
configTest()
switch("out", "tests/init_resource/nif.so")
setCommand("compile", "tests/init_resource/nif")
task test_init_resource, "run test":
exec("elixir -r tests/init_resource/NimlerWrapper.ex tests/init_resource/test.exs")
task build_dirty_nif, "build nif":
configTest()
switch("out", "tests/dirty_nif/nif.so")
setCommand("compile", "tests/dirty_nif/nif")
task test_dirty_nif, "run test":
exec("elixir -r tests/dirty_nif/NimlerWrapper.ex tests/dirty_nif/test.exs")
task build_timeslice, "build nif":
configTest()
switch("out", "tests/timeslice/nif.so")
setCommand("compile", "tests/timeslice/nif")
task test_timeslice, "run test":
exec("elixir -r tests/timeslice/NimlerWrapper.ex tests/timeslice/test.exs")
task build_message, "build nif":
configTest()
switch("out", "tests/message/nif.so")
setCommand("compile", "tests/message/nif")
task test_message, "run test":
exec("elixir -r tests/message/NimlerWrapper.ex tests/message/test.exs")
task build_positional, "build nif":
configTest()
switch("out", "tests/positional/nif.so")
setCommand("compile", "tests/positional/nif")
task test_positional, "run test":
exec("elixir -r tests/positional/NimlerWrapper.ex tests/positional/test.exs")
task run_init_api, "run test":
exec("nimble build_init_api")
exec("nimble test_init_api")
task run_integration, "run test":
exec("nimble build_integration")
exec("nimble test_integration")
task run_codec, "run test":
exec("nimble build_codec")
exec("nimble test_codec")
task run_dirty_nif, "run test":
exec("nimble build_dirty_nif")
exec("nimble test_dirty_nif")
task run_init_resource, "run test":
exec("nimble build_init_resource")
exec("nimble test_init_resource")
task run_resource, "run test":
exec("nimble build_resource")
exec("nimble test_resource")
task run_timeslice, "run test":
exec("nimble build_timeslice")
exec("nimble test_timeslice")
task run_message, "run test":
exec("nimble build_message")
exec("nimble test_message")
task run_positional, "run test":
exec("nimble build_positional")
exec("nimble test_positional")