Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
139 lines (118 loc) · 2.89 KB
/
Copy pathTaskfile.yml
File metadata and controls
139 lines (118 loc) · 2.89 KB
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
# go-booba-example - Copyright (c) 2026 Neomantra Corp.
version: '3'
vars:
GOLANGCI_LINT_VERSION: v2.10.1
tasks:
default:
desc: 'Default task runs the "test" and "build" tasks'
deps:
- test
- 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 github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}}
- go install github.com/kisielk/errcheck@latest
build:
desc: 'Build native binary and WASM assets'
deps:
- build-native
- build-native-server
- build-web
test:
desc: 'Test go-booba-example'
deps:
- go-test
serve:
desc: 'Serve web/ locally on http://localhost:3000'
deps: [build-web]
cmds:
- npx serve web
run:
desc: 'Run native example binary'
deps: [build-native]
cmds:
- bin/example
run-server:
desc: 'Run native server example binary'
deps: [build-native-server]
cmds:
- bin/example-server
###############################################################################
go-tidy:
desc: 'Go tidy all the things'
cmds:
- go mod tidy
go-update:
desc: 'Go update all the dependencies'
cmds:
- go get -u ./...
go-lint:
desc: Run golangci-lint with errcheck
cmds:
- golangci-lint run --enable=errcheck --timeout=5m ./...
go-test:
desc: 'Run Go tests'
deps: [go-tidy]
cmds:
- go test ./...
build-native:
desc: 'Build native example binary'
deps: [go-tidy]
cmds:
- go build -o bin/example ./cmd/example/
sources:
- cmd/example/*.go
- internal/model/*.go
generates:
- bin/example
build-native-server:
desc: 'Build native server example binary'
deps: [go-tidy]
cmds:
- go build -o bin/example-server ./cmd/example-server/
sources:
- cmd/example-server/*.go
- internal/model/*.go
generates:
- bin/example-server
build-wasm:
desc: 'Compile example to WASM'
deps: [go-tidy]
env:
GOOS: js
GOARCH: wasm
cmds:
- go build -o web/app.wasm ./cmd/example/
sources:
- cmd/example/*.go
- internal/model/*.go
generates:
- web/app.wasm
build-assets:
desc: 'Populate web/ with wasm_exec.js, booba/, and ghostty-web/'
cmds:
- go tool booba-assets web/
generates:
- web/wasm_exec.js
- web/booba/booba.js
- web/ghostty-web/ghostty-web.js
build-web:
desc: 'Build WASM binary and web assets'
deps:
- build-wasm
- build-assets
clean:
desc: 'Clean build artifacts'
cmds:
- rm -f bin/example
- rm -f bin/example-server
- rm -f web/app.wasm
- rm -f web/wasm_exec.js
- rm -rf web/booba
- rm -rf web/ghostty-web