-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfes.nimble
42 lines (34 loc) · 1.22 KB
/
fes.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
# Package
version = "0.0.1"
author = "Laeri"
description = "A compiler for a forth like programming language to the NES (Nintendo Entertainment System)"
license = "MIT"
srcDir = "src"
bin = @["fes"]
# Dependencies
requires "nim >= 0.18.0"
requires "docopt"
task run, "Run a file in the src/fespkg folder and generate binaries in bin/":
if paramCount() < 2:
quit(QuitFailure)
else:
var src_name = paramStr(2)
exec "nim c " & " -o=bin/" & src_name & " -r src/fespkg/" & src_name
task comp, "Compile a file in the src/fespkg folder and generate binares in bin/":
if paramCount() < 2:
quit(QuitFailure)
else:
var src_name = paramStr(2)
exec "nim c" & " -o=bin/" & src_name & " src/fespkg/" & src_name
task tests, "Run all tests in tests/ folder":
exec "nim c -r " & " -o=bin/runtests tests/runtests"
task test, "Run specified test in tests/ folder":
if paramCount() < 2:
quit(QuitFailure)
else:
var specific_tests = ""
if param_count() >= 3:
for i in 3..paramCount():
specific_tests &= " " & "\"" & paramStr(i) & "\""
var src_name = paramStr(2)
exec "nim c -r " & " -o=bin/" & src_name & " -r tests/" & src_name & specific_tests