forked from vs-shirokii/gzdoom-rt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskfile.yaml
248 lines (226 loc) · 7.34 KB
/
taskfile.yaml
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
# yaml-language-server: $schema=https://taskfile.dev/schema.json
# https://taskfile.dev
version: "3"
env:
VCPKG_ROOT: "{{.TASKFILE_DIR}}/libraries/vcpkg"
vars:
VCPKG_ROOT: "{{.TASKFILE_DIR}}/libraries/vcpkg"
VCPKG_BOOTSTRAP_BAT: "{{.TASKFILE_DIR}}/libraries/vcpkg/bootstrap-vcpkg.bat"
VCPKG_BOOTSTRAP_SH: "{{.TASKFILE_DIR}}/libraries/vcpkg/bootstrap-vcpkg.sh"
VCPKG_CMAKE: '{{ joinPath .TASKFILE_DIR "libraries" "vcpkg" "scripts" "buildsystems" "vcpkg.cmake" }}'
VCPKG_BOOTSTRAP: >-
{{if eq OS "windows"}}{{.VCPKG_BOOTSTRAP_BAT}}{{else}}{{.VCPKG_BOOTSTRAP_SH}}{{end}}
VCPKG_EXE: "{{.TASKFILE_DIR}}/libraries/vcpkg/vcpkg{{exeExt}}"
BUILD_DIR_NAME: build
OUTPUT_EXE_PATH: RelWithDebInfo/gzdoom.exe
RUN_WINDOWS: cmd /d /e:on /c
RUN_UNIX: bash -c
RUN: '{{if eq OS "windows"}}{{.RUN_WINDOWS}}{{ else }}{{.RUN_UNIX}}{{ end }}'
tasks:
default:
cmds:
- task: build
clean:
silent: true
cmds:
- cmd: git add .
ignore_error: true
- task: git-clean
git-clean:
vars:
CLOSE_STDIN: '{{if eq OS "windows"}}<nul{{else}}0<&-{{end}}'
cmds:
- cmd: git submodule foreach --recursive git add .
silent: true
ignore_error: true
- cmd: git submodule foreach --recursive git clean -xfd {{.CLOSE_STDIN}}
silent: true
ignore_error: true
- cmd: git add .
- cmd: git clean -xfd {{.CLOSE_STDIN}}
silent: true
ignore_error: true
rebuild:
cmds:
- task: clean
- task: build
run:
deps: [cmake-install]
cmds:
- cmd: >-
cmd.exe /D /E:ON /C \
start "taskfile-run" /D "{{joinPath .TASKFILE_DIR "bin"}}" "{{joinPath .TASKFILE_DIR .OUTPUT_EXE_PATH}}"
platforms: [windows]
vcpkg-integrate:
deps: [vcpkg-download]
env:
VCPKG_ROOT: '{{joinPath .TASKFILE_DIR "libraries" "vcpkg"}}'
sources:
- vcpkg.json
generates:
- vcpkg_installed/vcpkg/vcpkg-lock.json
- vcpkg_installed/*-*/lib/*.lib
- vcpkg_installed/*-*/lib/*.a
- vcpkg_installed/*-*/include/**/*.h
vars:
VCPKG_ROOT_ARG: --vcpkg-root "{{joinPath .TASKFILE_DIR "libraries" "vcpkg "}}"
cmds:
- cmd: >-
{{.RUN}} ""{{ fromSlash .VCPKG_EXE | shellQuote }}" integrate install"
platforms: [windows]
- cmd: >-
{{.RUN}} ""{{ fromSlash .VCPKG_EXE | shellQuote }}" install --debug --keep-going"
platforms: [windows]
vcpkg-download:
deps: [git-submodule-init]
status:
- test -f "{{.VCPKG_EXE}}"
env:
VCPKG_ROOT: '{{joinPath .TASKFILE_DIR "libraries" "vcpkg"}}'
cmds:
- cmd: '{{.RUN}} "{{ fromSlash .VCPKG_BOOTSTRAP }}" -disableMetrics'
apt-install:
platforms: [linux]
cmds:
- cmd: |
sudo apt install -y --no-install-recommends \
git build-essential autoconf libtool
dependencies:
internal: true
deps: [git-submodule-init]
cmds:
- task: vcpkg-integrate
- task: python-venv
build:
deps: [dependencies]
env:
ZMUSIC_ROOT: '{{joinPath .TASKFILE_DIR "libraries" "zmusic"}}'
VCPKG_ROOT: '{{joinPath .TASKFILE_DIR "libraries" "vcpkg"}}'
VCPKG_INSTALLED: '{{joinPath .TASKFILE_DIR "vcpkg_installed"}}'
VCPKG_INSTALLED_DIR: '{{joinPath .TASKFILE_DIR "vcpkg_installed"}}'
SOURCE_ROOT: '{{.TASKFILE_DIR}}'
BUILD_ROOT: '{{joinPath .TASKFILE_DIR ".build"}}'
ZMUSIC_BUILD_ROOT: '{{joinPath .TASKFILE_DIR ".build" "zmusic"}}'
DOOM_BUILD_ROOT: '{{joinPath .TASKFILE_DIR ".build" "doom"}}'
RTGL1_SDK_PATH: '{{joinPath .TASKFILE_DIR "libraries" "RTGL"}}'
cmds:
- cmd: | # shell
{{if .CLI_FORCE}}rm -rf "$BUILD_ROOT" "$VCPKG_INSTALLED" "$ZMUSIC_BUILD_ROOT"{{end}}
- cmd: | # shell
mkdir "$BUILD_ROOT" "$VCPKG_INSTALLED" "$ZMUSIC_BUILD_ROOT" || true
- cmd: | # shell
rye run cmake \
-S "$ZMUSIC_ROOT" -B "$ZMUSIC_BUILD_ROOT" \
{{if eq OS "windows"}}-A x64{{else}}-G Ninja{{end}} \
-D CMAKE_TOOLCHAIN_FILE="{{ .VCPKG_CMAKE }}" \
-DVCPKG_LIBSNDFILE=1 \
-DVCPKG_INSTALLED_DIR="{{ joinPath .TASKFILE_DIR "vcpkg_installed" }}"
- cmd: | # shell
rye run cmake \
--build "$ZMUSIC_BUILD_ROOT" --config Release \
{{if eq OS "windows"}}-- -maxcpucount -verbosity:minimal{{end}}
- cmd: | # shell
rye run cmake \
-S "$SOURCE_ROOT" -B "$DOOM_BUILD_ROOT" \
{{if eq OS "windows"}}-A x64{{else}}-G Ninja{{end}} \
-DCMAKE_TOOLCHAIN_FILE="{{ .VCPKG_CMAKE }}" \
-DZMUSIC_INCLUDE_DIR="$ZMUSIC_ROOT/include" \
-DZMUSIC_LIBRARIES="$ZMUSIC_BUILD_ROOT/source/Release/zmusic.lib" \
-DVCPKG_INSTALLED_DIR="{{ joinPath .TASKFILE_DIR "vcpkg_installed" }}"
- cmd: | # shell
rye run cmake \
--build "$DOOM_BUILD_ROOT" \
--config RelWithDebInfo \
{{if eq OS "windows"}}-- -maxcpucount -verbosity:minimal{{end}}
make:
deps: [python-venv]
cmds:
- cmd: cmd.exe /D /C "call .venv/Scripts/activate.bat && make"
python-venv:
sources:
- pyproject.toml
generates:
- ./.venv/rye-venv.json
- ./requirements.lock
- ./requirements-dev.lock
cmds:
- cmd: rye sync
python-build:
deps: [python-venv, git-submodule-init]
aliases: [py-build, pyb, build-py]
silent: true
sources:
- gzdoom-rt-*/**/pyproject.toml
- gzdoom-rt-*/**/requirements*.lock
- gzdoom-rt-*/**/*.py
generates:
- ./dist/activitywatch-*.tar.gz
cmds:
- cmd: rye build
deps-windows:
status:
- git --version
- make --version
- python --version
- poetry --version
- node --version
- npm --version
- rustc --version
- cargo --version
- 7z
cmds:
- cmd: |
scoop install \
extras/inno-setup \
main/7zip \
main/uutils-coreutils
git-submodule-init:
sources:
- .gitmodules
status:
- test -f "{{.VCPKG_BOOTSTRAP_BAT}}"
- test -f "{{.VCPKG_BOOTSTRAP_SH}}"
cmds:
- cmd: |
if [ -f "{{joinPath .TASKFILE_DIR ".gitmodules"}}" ]; then
git -C "{{.TASKFILE_DIR}}" submodule update --init --recursive
fi
silent: true
clang-format:
aliases: [fmt, format]
sources:
- src/**/*.c
- src/**/*.h
cmds:
- for: sources
cmd: |
clang-format -i "{{joinPath .TASKFILE_DIR .ITEM}}"
tidy:
sources:
- src/**/*.c
- src/**/*.h
cmds:
- for: sources
task: clang-tidy
vars: { CLANG_TIDY_SOURCE: "{{.ITEM}}" }
clang-tidy:
requires:
vars: [CLANG_TIDY_SOURCE]
vars:
CLANG_TIDY_OUT_FILE: '.build/{{splitList "/" (toSlash .CLANG_TIDY_SOURCE) | last}}.out'
sources:
- "{{.CLANG_TIDY_SOURCE}}"
generates:
- "{{.CLANG_TIDY_OUT_FILE}}"
cmds:
- cmd: mkdir "{{joinPath .TASKFILE_DIR ".build"}}"
silent: true
ignore_error: true
- cmd: |
clang-tidy "{{joinPath .TASKFILE_DIR .CLANG_TIDY_SOURCE}}" \
--config-file="{{joinPath .TASKFILE_DIR ".clang-tidy"}}" \
--use-color \
--fix \
--fix-notes \
--fix-errors \
> "{{joinPath .TASKFILE_DIR .CLANG_TIDY_OUT_FILE | fromSlash}}"