-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
199 lines (176 loc) · 6.6 KB
/
Taskfile.yml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
version: '3'
tasks:
help:
cmds:
- go-task -a
silent: true
desc: "Show this pages"
default:
- task: help
build:
preconditions:
- sh: '{{if eq OS "windows"}} powershell.exe -Command Test-Path dist {{else}} test ! -d dist {{end}}'
msg: "Nothing to be done."
cmds:
- meson setup build --prefix=$(pwd)
- ninja -C build install
silent: true
desc: "Build the project in release build"
build-strip:
preconditions:
- sh: '{{if eq OS "windows"}} powershell.exe -Command Test-Path dist {{else}} test ! -d dist {{end}}'
msg: "Nothing to be done."
cmds:
- meson setup build --strip --prefix=$(pwd)
- ninja -C build install
silent: true
desc: "Build the project in release build in stripped mode"
norm:
platforms: ["linux"]
preconditions:
- sh: 'test -d build'
msg: "Norm required compile_commands.json files please build the project before !"
cmds:
- CLANG_TIDY=$(clang-tidy -p ./build src/**/*.c | grep "warning"); [[ ! -z "$CLANG_TIDY" ]] && echo $CLANG_TIDY && exit 1 || exit 0;
silent: true
desc: "Pass the norm on the project"
build-dev:
preconditions:
- sh: '{{if eq OS "windows"}} powershell.exe -Command Test-Path dist {{else}} test ! -d dist {{end}}'
msg: "Nothing to be done."
cmds:
- meson setup build --buildtype=debug --prefix=$(pwd)
- ninja -C build install
silent: true
desc: "Build the project in dev build"
cross-build:
preconditions:
- sh: '{{if eq OS "windows"}} powershell.exe -Command Test-Path dist {{else}} test ! -d dist {{end}}'
msg: "Nothing to be done."
cmds:
- meson setup --cross {{.CLI_ARGS}} build --prefix=$(pwd)
- ninja -C build install
silent: true
desc: "Build the project with the compiler of your choice in release mode"
cross-build-dev:
preconditions:
- sh: '{{if eq OS "windows"}} powershell.exe -Command Test-Path dist {{else}} test ! -d dist {{end}}'
msg: "Nothing to be done."
cmds:
- meson setup --cross {{.CLI_ARGS}} build --buildtype=debugoptimized --prefix=$(pwd)
- ninja -C build install
silent: true
desc: "Build the project with the compiler of your choice in dev mode"
re:
cmds:
- meson setup build --reconfigure --prefix=$(pwd)
- ninja -C build install
silent: true
desc: "Re build the project"
re-dev:
cmds:
- meson setup build --reconfigure --buildtype=debugoptimized --prefix=$(pwd)
- ninja -C build install
silent: true
desc: "Re build the project in dev mode"
re-strip:
cmds:
- meson setup build --reconfigure --strip --prefix=$(pwd)
- ninja -C build install
silent: true
desc: "Re build the project with strip"
build-tests:
cmds:
- meson setup build --reconfigure -Dbuild_tests=true --prefix=$(pwd)
- ninja -C build
silent: true
desc: "Build tests files"
run-tests:
preconditions:
- sh: '{{if eq OS "windows" }} powershell.exe -Command Test-Path build {{else}} test -d build {{end}}'
msg: "Build directory not exist please run task build-tests before"
cmds:
- meson test -C build
silent: true
desc: "Run tests files"
run-tests-verbose:
preconditions:
- sh: '{{if eq OS "windows" }} powershell.exe -Command Test-Path build {{else}} test -d build {{end}}'
msg: "Build directory not exist please run build_tests before"
cmds:
- meson test -C build --verbose
silent: true
desc: "Run tests files with verbosity"
run-tests-valgrind:
platforms: ["linux"]
preconditions:
- sh: 'test -d build && test -f /usr/bin/valgrind'
msg: "Build directory not exist please run build_tests before or valgrind is missing !"
cmds:
- meson test -C build --verbose --wrapper=valgrind
silent: true
desc: "Run tests files with valgrind"
list-tests:
preconditions:
- sh: '{{if eq OS "windows" }} powershell.exe -Command Test-Path build {{else}} test -d build {{end}}'
msg: "Build directory not exist please run build_tests before"
cmds:
- meson test -C build --list
silent: true
desc: "List all tests"
run-test-suite:
preconditions:
- sh: '{{if eq OS "windows" }} powershell.exe -Command Test-Path build {{else}} test -d build {{end}}'
msg: "Build directory not exist please run build_tests before"
cmds:
- meson test -C build --verbose {{.CLI_ARGS}}
silent: true
desc: "Run specified tests suite"
run-test-suite-valgrind:
platforms: ["linux"]
preconditions:
- sh: 'test -d build && test -d /usr/bin/valgrind'
msg: "Build directory not exist please run build_tests before"
cmds:
- meson test -C build --verbose --wrapper=valgrind {{.CLI_ARGS}}
silent: true
desc: "Run specified tests suite with valgrind"
install:
platforms: ["linux"]
preconditions:
- test -d dist
cmds:
- sudo cp ./dist/shared/*.so ./dist/static/*.a /usr/lib/
- sudo mkdir -p /usr/include/etheria/
- sudo cp ./inc/eth-std.h /usr/include/etheria/
- echo -e "[\033[32m+\033[00m] Installed successfully at \033[32m$(ls /usr/lib/ | grep libetheria)\033[00m !"
silent: true
desc: "Install library on the system"
prompt: "Do you want install in (/usr/lib/)"
rm_install:
platforms: ["linux"]
preconditions:
- test -f /usr/lib/libetheria-std.a
- test -f /usr/lib/libetheria-std.so
- test -d /usr/include/etheria/
cmds:
- sudo rm -rf /usr/lib/libetheria-std.a /usr/lib/libetheria-std.so /usr/include/etheria/
- echo -e "[\033[32m+\033[00m] Removed successfully !"
silent: true
desc: "Remove installed etheria Standard library on the system"
prompt: "Do you want remove etheria-std library"
clean:
cmds:
- '{{if eq OS "windows" }} cmd.exe /c rmdir build /S /Q {{else}} rm -rf build {{end}}'
- '{{if eq OS "windows" }} cmd.exe /c echo clean build directory removed {{else}} echo -e "[\033[32m+\033[00m] clean \033[32mbuild\033[00m directory removed \033[32msuccessully\033[00m !" {{end}}'
silent: true
desc: "Clean build directory"
fclean:
deps:
- clean
cmds:
- cmd: '{{if eq OS "windows"}} cmd.exe /c rmdir dist /S /Q {{else}} rm -rf dist {{end}}'
ignore_error: true
- '{{if eq OS "windows"}} cmd.exe /c echo clean dist directory removed ! {{else}} echo -e "[\033[32m+\033[00m] clean \033[32mdist\033[00m directory removed \033[32msuccessully\033[00m !"{{end}}'
silent: true
desc: "Full clean remove build directory and dist directory"