-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
329 lines (298 loc) · 11.9 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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# ntcharts - Copyright (c) 2024 Neomantra Corp.
version: '3'
tasks:
default:
desc: 'Default task runs the "build" task'
deps:
- build
list:
desc: 'Lists available tasks'
cmds:
- task --list-all
dev-deps:
desc: 'Install developer dependencies'
cmds:
- go install 'golang.org/x/tools/cmd/godoc@latest'
- go install 'golang.org/x/pkgsite/cmd/pkgsite@latest'
###############################################################################
go-tidy:
desc: 'Go tidy all the things'
cmds:
- go mod tidy
go-update:
desc: 'Go update all the dependencies'
cmds:
- go get -u ./...
build:
desc: 'Build all the things'
deps:
- build-cmds
- build-examples
clean:
desc: 'Clean commands and examples)'
deps:
- clean-cmds
- clean-examples
go-doc-server:
desc: 'Run Go gdoc documentation server'
cmds:
- echo 'http://localhost:6060/pkg/github.com/NimbleMarkets/ntcharts/'
- godoc -http=:6060
deps:
- dev-deps
- go-tidy
go-pkgsite-server:
desc: 'Run Go pkgsite documentation server'
cmds:
- echo 'http://localhost:6061/pkg/github.com/NimbleMarkets/ntcharts/'
- pkgsite -http=:6061
deps:
- dev-deps
- go-tidy
###############################################################################
# Commands
build-cmds:
desc: 'Build all commands'
deps:
- build-cmd-ntcharts-ohlc
build-cmd-ntcharts-ohlc:
desc: 'Build ntcharts-ohlc command'
deps: [go-tidy]
cmds:
- go build -o bin/ntcharts-ohlc cmd/ntcharts-ohlc/*.go
sources:
- cmd/ntcharts-ohlc/*.go
- canvas/**/*.go
- linechart/**/*.go
generates:
- bin/ntcharts-ohlc
clean-cmds:
desc: 'Cleans all commands'
cmds:
- rm -f bin/ntcharts-ohlc
###############################################################################
# Examples
build-examples:
desc: 'Build all examples'
deps:
- build-ex-barchart
- build-ex-canvas
- build-ex-graph
- build-ex-heatmap
- build-ex-linechart
- build-ex-quickstart
- build-ex-sparkline
build-ex-barchart:
desc: 'Build barchart examples'
deps: [go-tidy]
cmds:
- go build -o bin/ntcharts-barchart-horizontal examples/barchart/horizontal/*.go
- go build -o bin/ntcharts-barchart-vertical examples/barchart/vertical/*.go
sources:
- barchart/**/*.go
- canvas/**/*.go
- examples/barchart/**/*.go
generates:
- bin/ntcharts-barchart-horizontal
- bin/ntcharts-barchart-vertical
build-ex-canvas:
desc: 'Build canvas example'
deps: [go-tidy]
cmds:
- go build -o bin/ntcharts-canvas-logo examples/canvas/logo/*.go
sources:
- examples/canvas/logo/*.go
- canvas/**/*.go
generates:
- bin/ntcharts-canvas-logo
build-ex-graph:
desc: 'Build graph examples'
deps: [go-tidy]
cmds:
- go build -o bin/ntcharts-graph-braille examples/graph/braille/*.go
- go build -o bin/ntcharts-graph-candlesticks examples/graph/candlesticks/*.go
- go build -o bin/ntcharts-graph-circles examples/graph/circles/*.go
- go build -o bin/ntcharts-graph-columns examples/graph/columns/*.go
- go build -o bin/ntcharts-graph-lines examples/graph/lines/*.go
- go build -o bin/ntcharts-graph-rows examples/graph/rows/*.go
sources:
- canvas/**/*.go
- examples/graph/**/*.go
generates:
- bin/ntcharts-graph-braille
- bin/ntcharts-graph-candlesticks
- bin/ntcharts-graph-circles
- bin/ntcharts-graph-columns
- bin/ntcharts-graph-lines
- bin/ntcharts-graph-rows
build-ex-heatmap:
desc: 'Build heatmap examples'
deps: [go-tidy]
cmds:
- go build -o bin/ntcharts-heatmap-aoc2024 examples/heatmap/aoc2024/*.go
- go build -o bin/ntcharts-heatmap-functor examples/heatmap/functor/*.go
- go build -o bin/ntcharts-heatmap-perlin examples/heatmap/perlin/*.go
- go build -o bin/ntcharts-heatmap-simple examples/heatmap/simple/*.go
sources:
- heatmap/**/*.go
- canvas/**/*.go
- examples/heatmap/**/*.go
generates:
- bin/ntcharts-heatmap-aoc2024
- bin/ntcharts-heatmap-functor
- bin/ntcharts-heatmap-perlin
- bin/ntcharts-heatmap-simple
build-ex-linechart:
desc: 'Build linechart examples'
deps: [go-tidy]
cmds:
- go build -o bin/ntcharts-linechart-circles examples/linechart/circles/*.go
- go build -o bin/ntcharts-linechart-lines examples/linechart/lines/*.go
- go build -o bin/ntcharts-linechart-scatter examples/linechart/scatter/*.go
- go build -o bin/ntcharts-linechart-streaming examples/linechart/streaming/*.go
- go build -o bin/ntcharts-linechart-timeseries examples/linechart/timeseries/*.go
- go build -o bin/ntcharts-linechart-wavelines examples/linechart/wavelines/*.go
sources:
- canvas/**/*.go
- examples/linechart/**/*.go
- linechart/**/*.go
generates:
- bin/ntcharts-linechart-circles
- bin/ntcharts-linechart-lines
- bin/ntcharts-linechart-scatter
- bin/ntcharts-linechart-streaming
- bin/ntcharts-linechart-timeseries
- bin/ntcharts-linechart-wavelines
build-ex-quickstart:
desc: 'Build quickstart example'
deps: [go-tidy]
cmds:
- go build -o bin/ntcharts-quickstart examples/quickstart/*.go
sources:
- canvas/**/*.go
- examples/quickstart/*.go
- linechart/**/*.go
generates:
- bin/ntcharts-quickstart
build-ex-sparkline:
desc: 'Build sparkline example'
deps: [go-tidy]
cmds:
- go build -o bin/ntcharts-sparkline examples/sparkline/*.go
sources:
- canvas/**/*.go
- examples/sparkline/*.go
- sparkline/**/*.go
generates:
- bin/ntcharts-sparkline
clean-examples:
desc: 'Removes all examples from bin'
cmds:
- rm -f bin/ntcharts-barchart-horizontal bin/ntcharts-barchart-vertical
- rm -f bin/ntcharts-canvas-logo
- rm -f bin/ntcharts-heatmap-aoc2024 bin/ntcharts-heatmap-functor bin/ntcharts-heatmap-perlin bin/ntcharts-heatmap-simple
- rm -f bin/ntcharts-graph-braille bin/ntcharts-graph-candlesticks bin/ntcharts-graph-circles bin/ntcharts-graph-columns bin/ntcharts-graph-lines bin/ntcharts-graph-rows
- rm -f bin/ntcharts-linechart-circles bin/ntcharts-linechart-lines bin/ntcharts-linechart-scatter bin/ntcharts-linechart-streaming bin/ntcharts-linechart-timeseries bin/ntcharts-linechart-wavelines
- rm -f bin/ntcharts-quickstart
- rm -f bin/ntcharts-sparkline
###############################################################################
# GIF Generation from VHS Cassettes
deps-gifs:
desc: 'Install dependencies for GIF generation'
cmds:
- go install github.com/charmbracelet/vhs@latest
- brew install imagemagick
validate-tapes:
desc: 'Validate vhs tapes for GIF generation'
cmds:
- vhs validate ./cmd/ntcharts-ohlc/demo.tape
- vhs validate ./examples/barchart/horizontal/demo.tape
- vhs validate ./examples/barchart/vertical/demo.tape
- vhs validate ./examples/canvas/logo/demo.tape
- vhs validate ./examples/graph/braille/demo.tape
- vhs validate ./examples/graph/candlesticks/demo.tape
- vhs validate ./examples/graph/circles/demo.tape
- vhs validate ./examples/graph/columns/demo.tape
- vhs validate ./examples/graph/lines/demo.tape
- vhs validate ./examples/graph/rows/demo.tape
- vhs validate ./examples/heatmap/functor/demo.tape
- vhs validate ./examples/heatmap/perlin/demo.tape
- vhs validate ./examples/linechart/circles/demo.tape
- vhs validate ./examples/linechart/lines/demo.tape
- vhs validate ./examples/linechart/scatter/demo.tape
- vhs validate ./examples/linechart/streaming/demo.tape
- vhs validate ./examples/linechart/timeseries/demo.tape
- vhs validate ./examples/linechart/wavelines/demo.tape
- vhs validate ./examples/quickstart/demo.tape
- vhs validate ./examples/sparkline/demo.tape
sources:
- ./**/**/*.tape
build-gifs:
desc: 'Build vhs cassette gifs'
deps: [build, validate-tapes]
cmds:
- vhs --output ./cmd/ntcharts-ohlc/demo.gif ./cmd/ntcharts-ohlc/demo.tape
- vhs --output ./examples/barchart/horizontal/demo.gif ./examples/barchart/horizontal/demo.tape
- vhs --output ./examples/barchart/vertical/demo.gif ./examples/barchart/vertical/demo.tape
- vhs --output ./examples/canvas/logo/demo.gif ./examples/canvas/logo/demo.tape
- vhs --output ./examples/graph/braille/demo.gif ./examples/graph/braille/demo.tape
- vhs --output ./examples/graph/candlesticks/demo.gif ./examples/graph/candlesticks/demo.tape
- vhs --output ./examples/graph/circles/demo.gif ./examples/graph/circles/demo.tape
- vhs --output ./examples/graph/columns/demo.gif ./examples/graph/columns/demo.tape
- vhs --output ./examples/graph/lines/demo.gif ./examples/graph/lines/demo.tape
- vhs --output ./examples/graph/rows/demo.gif ./examples/graph/rows/demo.tape
- vhs --output ./examples/heatmap/functor/demo.gif ./examples/heatmap/functor/demo.tape
- vhs --output ./examples/heatmap/perlin/demo.gif ./examples/heatmap/perlin/demo.tape
- vhs --output ./examples/linechart/circles/demo.gif ./examples/linechart/circles/demo.tape
- vhs --output ./examples/linechart/lines/demo.gif ./examples/linechart/lines/demo.tape
- vhs --output ./examples/linechart/scatter/demo.gif ./examples/linechart/scatter/demo.tape
- vhs --output ./examples/linechart/streaming/demo.gif ./examples/linechart/streaming/demo.tape
- vhs --output ./examples/linechart/timeseries/demo.gif ./examples/linechart/timeseries/demo.tape
- vhs --output ./examples/linechart/wavelines/demo.gif ./examples/linechart/wavelines/demo.tape
- vhs --output ./examples/quickstart/demo.gif ./examples/quickstart/demo.tape
- vhs --output ./examples/sparkline/demo.gif ./examples/sparkline/demo.tape
sources:
- ./**/*.tape
generates:
- ./cmd/ntcharts-ohlc/demo.gif
- ./examples/barchart/horizontal/demo.gif
- ./examples/barchart/vertical/demo.gif
- ./examples/canvas/logo/demo.gif
- ./examples/graph/braille/demo.gif
- ./examples/graph/candlesticks/demo.gif
- ./examples/graph/circles/demo.gif
- ./examples/graph/columns/demo.gif
- ./examples/graph/lines/demo.gif
- ./examples/graph/rows/demo.gif
- ./examples/heatmap/functor/demo.gif
- ./examples/heatmap/perlin/demo.gif
- ./examples/linechart/circles/demo.gif
- ./examples/linechart/lines/demo.gif
- ./examples/linechart/scatter/demo.gif
- ./examples/linechart/streaming/demo.gif
- ./examples/linechart/timeseries/demo.gif
- ./examples/linechart/wavelines/demo.gif
- ./examples/sparkline/demo.gif
clean-gifs:
desc: 'Cleans vhs cassette gifs'
cmds:
- rm -f ./cmd/ntcharts-ohlc/demo.gif
- rm -f ./examples/barchart/horizontal/demo.gif
- rm -f ./examples/barchart/vertical/demo.gif
- rm -f ./examples/canvas/logo/demo.gif
- rm -f ./examples/graph/braille/demo.gif
- rm -f ./examples/graph/candlesticks/demo.gif
- rm -f ./examples/graph/circles/demo.gif
- rm -f ./examples/graph/columns/demo.gif
- rm -f ./examples/graph/lines/demo.gif
- rm -f ./examples/graph/rows/demo.gif
- rm -f ./examples/heatmap/functor/demo.gif
- rm -f ./examples/heatmap/perlin/demo.gif
- rm -f ./examples/linechart/circles/demo.gif
- rm -f ./examples/linechart/lines/demo.gif
- rm -f ./examples/linechart/scatter/demo.gif
- rm -f ./examples/linechart/streaming/demo.gif
- rm -f ./examples/linechart/timeseries/demo.gif
- rm -f ./examples/linechart/wavelines/demo.gif
- rm -f ./examples/quickstart/demo.gif
- rm -f ./examples/sparkline/demo.gif