-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
281 lines (243 loc) · 9.25 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
version: "3"
tasks:
install:
run: once
deps:
- base:compile
- project:compile
- cli:install
- project:install
- vscode:install
dev:
run: once
deps:
- project:compile
cmds:
- cargo build --package=wipple-cli
- cargo run --bin wipple -- run example --compiler target/debug/wipplec --build-dir example/build
test:
run: once
deps:
- base:compile
cmds:
- cargo test --package=wipple-test -- {{.CLI_ARGS}}
test-with-coverage:
run: once
cmds:
- RUSTFLAGS="-Cinstrument-coverage -Clink-dead-code" LLVM_PROFILE_FILE="./target/debug/coverage-%p-%m.profraw" cargo test --package=wipple-test -- --test-threads=1 {{.CLI_ARGS}}
- task: coverage
coverage:
run: once
cmds:
- |
if ! [[ -z "$CI" ]]; then
rustup component add llvm-tools-preview
fi
if ! command -v grcov; then
cargo install grcov --force
fi
- rm -rf coverage && mkdir -p coverage
- grcov . --binary-path target/debug/ -s . -t cobertura,html --branch --ignore-not-existing --keep-only 'compiler/**/*' --keep-only 'interpreter/**/*' --keep-only 'render/**/*' -o coverage
# doctest:
# run: once
# cmds:
# - rm -rf artifacts/doctest && mkdir -p artifacts/doctest
# - for f in web/docs/src/tour/*.md; do echo -e "testing $(basename $f)" && cargo run --bin wipplec -- doctest $f --dependency artifacts/base.wippleinterface --link artifacts/base.wipplelibrary > artifacts/doctest/$(basename $f).xml; done
cli:install:
run: once
dir: cli
cmds:
- cargo install --bin wipplec --path . --force {{.CLI_ARGS}}
project:install:
run: once
deps:
- base:compile
- project:compile
dir: project
cmds:
- cargo install --bin wipple --path . --force {{.CLI_ARGS}}
vscode:install:
run: once
dir: vscode
cmds:
- if ! command -v code; then echo "skipping VSCode extension because VSCode is not installed"; exit 0; fi
- npx @vscode/vsce package --no-dependencies --skip-license --allow-missing-repository
- code --install-extension wipple-vscode-0.0.0.vsix
- rm wipple-vscode-0.0.0.vsix
install-dependencies:
run: once
deps:
- wasm:install-dependencies
- web:install-dependencies
wasm:install-dependencies:
run: once
dir: wasm
cmds:
- if ! command -v wasm-pack; then cargo install --version 0.12.1 --force wasm-pack; fi
wasm:build:
run: once
dir: wasm
cmds:
- ./build.sh
web:playground:bundle:
run: once
dir: web/playground
cmds:
- task base:compile
- cargo run --bin wipplec -- bundle-for-playground ../../library/base/*.wipple --output ./public/library/base.wipplebundle
- task --parallel web:playground:bundle:turtle web:playground:bundle:music web:playground:bundle:math
web:playground:bundle:turtle:
run: once
dir: web/playground
cmds:
- cargo run --bin wipplec -- compile ../../library/turtle/turtle.wipple --dependency ../../artifacts/base.wippleinterface --interface ../../artifacts/turtle.wippleinterface
- cargo run --bin wipplec -- bundle-for-playground ../../library/turtle/turtle.wipple --dependency ../../artifacts/base.wippleinterface --link ../../artifacts/base.wipplelibrary --output ./public/library/turtle.wipplebundle
web:playground:bundle:music:
run: once
dir: web/playground
cmds:
- cargo run --bin wipplec -- compile ../../library/music/music.wipple --dependency ../../artifacts/base.wippleinterface --interface ../../artifacts/music.wippleinterface
- cargo run --bin wipplec -- bundle-for-playground ../../library/music/music.wipple --dependency ../../artifacts/base.wippleinterface --link ../../artifacts/base.wipplelibrary --output ./public/library/music.wipplebundle
web:playground:bundle:math:
run: once
dir: web/playground
cmds:
- cargo run --bin wipplec -- compile ../../library/math/math.wipple --dependency ../../artifacts/base.wippleinterface --interface ../../artifacts/math.wippleinterface
- cargo run --bin wipplec -- bundle-for-playground ../../library/math/math.wipple --dependency ../../artifacts/base.wippleinterface --link ../../artifacts/base.wipplelibrary --output ./public/library/math.wipplebundle
web:install-dependencies:
run: once
deps:
- web:home:install-dependencies
- web:login:install-dependencies
- web:docs:install-dependencies
- web:doc-template:install-dependencies
- web:playground:install-dependencies
web:serve:
run: once
deps:
- web:build
cmds:
- netlify dev --filter wipple-playground
web:build:
run: once
deps:
- web:home:build
- web:login:build
- web:docs:build
- web:doc-template:build
- web:playground:build
dir: web
cmds:
- rm -rf dist && mkdir dist
- cp -r home/_site/. dist
- cp -r login/dist/. dist/login
- cp -r docs/book/. dist/docs
- cp doc-template/dist/index.html dist/doc-template.html
- cp -r playground/dist/. dist/playground
- task: web:library:docs:build
web:home:install-dependencies:
run: once
dir: web/home
cmds:
- npm install
web:home:serve:
run: once
dir: web/home
cmds:
- npm run dev
web:home:build:
run: once
dir: web/home
cmds:
- npm run build
web:login:install-dependencies:
run: once
dir: web/login
cmds:
- npm install
web:login:serve:
run: once
dir: web/login
cmds:
- npm run dev
web:login:build:
run: once
dir: web/login
cmds:
- npm run build
web:docs:install-dependencies:
run: once
dir: web/docs
cmds:
- if ! command -v mdbook; then cargo install --force mdbook; fi
- if ! command -v mdbook-template; then cargo install --force mdbook-template; fi
- if ! command -v mdbook-mermaid; then cargo install --force mdbook-mermaid; fi
web:docs:prepare:
run: once
dir: web/docs
cmds:
- (cd ../../compiler && cargo test --package=wipple-syntax render_grammar_to_html)
web:docs:serve:
run: once
deps:
- web:docs:prepare
dir: web/docs
cmds:
- mdbook serve
web:docs:build:
run: once
deps:
- web:docs:prepare
dir: web/docs
cmds:
- mdbook build
web:doc-template:install-dependencies:
run: once
dir: web/doc-template
cmds:
- npm install
web:doc-template:build:
run: once
dir: web/doc-template
cmds:
- npm run build
web:playground:install-dependencies:
run: once
dir: web/playground
cmds:
- npm install
web:playground:serve:
run: once
dir: web/playground
cmds:
- npm run dev
web:playground:build:
run: once
deps:
- wasm:build
- web:playground:bundle
dir: web/playground
cmds:
- npm run build
web:library:docs:build:
run: once
deps:
- web:doc-template:build
- web:playground:bundle
dir: web
cmds:
- mkdir -p dist/library/docs
- cargo run --bin wipplec -- doc --template-path ./doc-template/dist/index.html ../artifacts/base.wippleinterface --title 'Wipple Standard Library' --output ./dist/library/docs/base.html
- cargo run --bin wipplec -- doc --template-path ./doc-template/dist/index.html ../artifacts/turtle.wippleinterface --title 'Turtle' --output ./dist/library/docs/turtle.html
- cargo run --bin wipplec -- doc --template-path ./doc-template/dist/index.html ../artifacts/music.wippleinterface --title 'Music' --output ./dist/library/docs/music.html
- cargo run --bin wipplec -- doc --template-path ./doc-template/dist/index.html ../artifacts/math.wippleinterface --title 'Math' --output ./dist/library/docs/math.html
base:compile:
run: once
cmds:
- cargo run --bin wipplec -- compile library/base/*.wipple --interface artifacts/base.wippleinterface --library artifacts/base.wipplelibrary
project:compile:
run: once
deps:
- base:compile
cmds:
- cargo run --bin wipplec -- compile library/project/*.wipple --dependency artifacts/base.wippleinterface --interface artifacts/project.wippleinterface --library artifacts/project.wipplelibrary