-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.maple
98 lines (86 loc) · 3.24 KB
/
build.maple
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
plugins = [ 'v' ]
config:v_main = 'src/main.v'
config:musi_flags = '-syntax-debug'
config:sources = 'ast/ interpreter/ parser/ repl/ src/ stdlib/ tokenizer/ musi.v'
config:test_results_dir = 'testresults'
task:build.debug = {
help = 'Builds with debug flags'
category = 'build'
run = [
'mkdir -p ${v_build_dir}',
'${v} -o ${v_build_dir}/${v_build_filename} ${v_args} ${v_debug_args} ${v_main}'
]
}
task:build.debugprod = {
help = 'Builds with debug and prod flags'
category = 'build'
run = [
'mkdir -p ${v_build_dir}',
'${v} -o ${v_build_dir}/${v_build_filename} ${v_args} ${v_debug_args} -prod ${v_main}'
]
}
task:test.sample = {
help = 'Tests a specific sample'
category = 'test'
run = '${v} ${v_args} -g run ${v_main} run ${musi_flags} samples/${args}.musi'
}
task:test.samples = {
help = 'Tests each sample'
category = 'test'
depends = [ 'build.debug' ]
run = [
'mkdir -p ${test_results_dir}',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/bf.musi | tee ${test_results_dir}/bf.txt',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/fib.musi | tee ${test_results_dir}/fib.txt',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/fileio.musi | tee ${test_results_dir}/fileio.txt',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/hello.musi | tee ${test_results_dir}/hello.txt',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/stringformat.musi | tee ${test_results_dir}/stringformat.txt'
]
}
task:test.samples.prod = {
help = 'Tests each sample'
category = 'test'
depends = [ 'build.debugprod' ]
run = [
'mkdir -p ${test_results_dir}',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/bf.musi | tee ${test_results_dir}/bf.txt',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/fib.musi | tee ${test_results_dir}/fib.txt',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/fileio.musi | tee ${test_results_dir}/fileio.txt',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/hello.musi | tee ${test_results_dir}/hello.txt',
'${v_build_dir}/${v_build_filename} run ${musi_flags} samples/stringformat.musi | tee ${test_results_dir}/stringformat.txt'
]
}
task:test.musi = {
help = 'Tests everything in the `tests` folder'
category = 'test'
run = '${v} ${v_args} -g run ${v_main} run ${musi_flags} tests/all.musi'
}
task:install = {
help = 'Installs the musi CLI to ~/.local/bin/musi'
category = 'install'
depends = [ 'build.prod' ]
run = [
'rm ~/.local/bin/musi',
'ln -s $(pwd)/build/main ~/.local/bin/musi'
]
}
task:doc = {
help = 'Generates HTML documentation for the musi API'
category = 'docs'
run = '${v} doc -f html -o apidocs/ -readme -m .'
}
task:vet = {
help = 'Runs vvet on all of musi. this exists primarily for gitpod instances, where the v/ directory exist which we should ignore from vvet'
category = 'misc'
run = '${v} vet -FIpr ${sources}'
}
task:fmt = {
help = 'Runs vfmt on all of musi. this exists primarily for gitpod instances, where the v/ directory exist which we should ignore from vfmt'
category = 'misc'
run = '${v} fmt -w ${sources}'
}
task:cloc = {
help = 'Count lines of code'
category = 'misc'
run = 'cloc --read-lang-def=misc/cloc-lang-def.txt ${sources} tests/ samples/ doc/'
}