forked from mmulet/term.everything
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.dist.yml
More file actions
executable file
·217 lines (186 loc) · 5.77 KB
/
Taskfile.dist.yml
File metadata and controls
executable file
·217 lines (186 loc) · 5.77 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
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
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
tasks:
default:
cmds:
- task: run
desc: see run. Run with `task` and no args
run:
deps:
- build
cmds:
- bun run src/index.ts {{.CLI_ARGS}}
desc: builds && Runs the wayland compositor. Run with `task` and no args
env:
# DEBUG_TURN_OFF_OUTPUT: 1
# WAYLAND_DEBUG: 1
DEV: 1
WAYLAND_DEBUG_HIDE_SURFACE_AND_BUFFER_MESSAGES: 1
silent: true
profile:
deps:
- build
cmds:
# - clear
- bun run --inspect-wait=6499 src/index.ts {{.CLI_ARGS}}
desc: builds && Runs the wayland compositor. Run with `task` and no args
env:
# WAYLAND_DEBUG: 1
DEV: 1
WAYLAND_DEBUG_HIDE_SURFACE_AND_BUFFER_MESSAGES: 1
silent: true
build:
deps:
- scripts:bun-install-types:run
- c-interop:build
- scripts:gen-protocol:build
desc: Build everything need to run term.everything!mmulet.com
# Shared publish flow (handles both local and podman)
publish:_common:
internal: true
deps:
- build
silent: true
env:
NO_STRIP: 1
vars:
MODE: "{{.MODE | default `local`}}" # local | podman
cmds:
# Patch the canvas module so that it will work with appimage
- cp ./patches/canvas/new.js ./node_modules/canvas/lib/bindings.js
- defer: cp ./patches/canvas/old.js ./node_modules/canvas/lib/bindings.js
- echo "If you get exit status 134, just run \`task publish-{{.MODE}}\` again a few times. This is a bug in bun."
- bun build src/index.ts --compile --sourcemap --asset-naming="[name].[ext]" --outfile deps/{{.APP_NAME}}
- sed -i 's/bunfs\/root\/canvas-[^\.]+\.node/ORIGIN\/..\/lib\/cavnas.node/g' deps/{{.APP_NAME}}
- rm -rf Appdir
- mkdir -p Appdir
- mkdir -p dist
- |
set -euo pipefail
cd dist
if [ "{{.MODE}}" = "podman" ]; then
(cd "{{.ROOT_DIR}}/third_party" && ./linuxdeploy-x86_64.AppImage --appimage-extract)
DEPLOY="{{.ROOT_DIR}}/third_party/squashfs-root/AppRun"
else
DEPLOY="{{.ROOT_DIR}}/third_party/linuxdeploy-x86_64.AppImage"
fi
"$DEPLOY" \
--executable="{{.ROOT_DIR}}/deps/{{.APP_NAME}}" \
--library="{{.ROOT_DIR}}/deps/libinterop/lib/x86_64-linux-gnu/interop.node" \
--library="{{.ROOT_DIR}}/node_modules/canvas/build/Release/canvas.node" \
--appdir="{{.ROOT_DIR}}/Appdir" \
--desktop-file="{{.ROOT_DIR}}/resources/term.everything❗mmulet.com-dont_forget_to_chmod_+x_this_file.desktop" \
--icon-file="{{.ROOT_DIR}}/resources/icon.png" \
--output appimage
publish-local:
cmds:
- task: publish:_common
vars:
MODE: local
silent: true
desc: Publish into single file executable appimage (local host)
distribute:
desc: Create a distributable appimage using podman
cmds:
- chmod +x ./distribute.sh
- ./distribute.sh
publish-podman:
cmds:
- task: publish:_common
vars:
MODE: podman
silent: true
desc: Publish into single file executable appimage, (*Note* If you get exit status 134, just try again a few times, this is a (random) bug in bun)
fix-that-stupid-publish-error:
silent: true
cmds:
- ./third_party/appimagetool-x86_64.AppImage $(realpath ./Appdir)
clean-repo:
deps:
- c-interop:clean
- scripts:gen-protocol:clean
- clean-publish
desc: Clean (removes the output and build artifacts) from everything except third-party code
clean-publish:
cmds:
- rm -rf dist
- rm -rf Appdir
- rm -rf deps
# clean-repo plus third-party code
clean-all:
deps:
- clean-repo
- scripts:bun-install-types:clean
desc: Cleans everything (removes output and build artifacts)
# some useful shortcuts
commit:
deps:
- scripts:hide-show:hide
cmds:
- git add -A
- git commit
desc: shortcut for `task hide-etc; git add -A; git commit`
silent: true
check:
deps:
- scripts:bun-install-types:run
cmds:
- bunx tsc
silent: true
desc: Type check the typescript code (ie run `tsc`)
# scripts
hide-etc:
cmds:
- task: scripts:hide-show:hide
desc: Hide tools and deps from vscode (use show-etc to show)
show-etc:
cmds:
- task: scripts:hide-show:show
desc: UnHide tools and deps from vscode (use hide-etc to show)
make-source:
cmds:
- task: scripts:make-source
vars:
JS_FUNC: "{{.JS_FUNC}}"
desc: Make a .c in c_interop/src, .h file in c_interop/include and adds the source to c_interop/meson.build `task make-source [JS_FUNC=1] NAME=<name>`
remove-source:
cmds:
- task: scripts:make-source:remove
desc: |
Remove a source made with `task make-source `,
will use git to refuse to remove source files with uncommitted changes.
`task remove-source [JS_FUNC=1] NAME=<name>`
vars:
JS_FUNC: "{{.JS_FUNC}}"
FORCE: "{{.FORCE}}"
make-w-i-o:
cmds:
- task: scripts:make-wayland-interface-object
silent: true
vars:
NAME: "{{.NAME}}"
GLOBAL: "{{.GLOBAL}}"
FORCE: "{{.FORCE}}"
includes:
c-interop:
taskfile: ./c_interop
internal: true
third-party:
taskfile: ./third_party
internal: true
scripts:
taskfile: ./scripts
internal: true
test:
taskfile: ./tests
silent: true
vars:
APP_NAME: term.everything!mmulet.com
PROTOCOLs_OUT_DIR: src/protocols
PODMAN_ROOT: ./.podman
PODMAN_RUNROOT: ./.podman-run
PODMAN: podman --root {{.PODMAN_ROOT}} --runroot {{.PODMAN_RUNROOT}}
glib_out_dir: deps/glib
chafa_OUT_DIR: deps/chafa
chafa_LIB_DIR: "{{.chafa_OUT_DIR}}/lib"
chafa_PKG_CONFIG_PATH: "{{.chafa_LIB_DIR}}/pkgconfig"