forked from LostArtefacts/TRX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
116 lines (96 loc) · 4.16 KB
/
Copy pathjustfile
File metadata and controls
116 lines (96 loc) · 4.16 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
CWD := `pwd`
HOST_USER_UID := `id -u`
HOST_USER_GID := `id -g`
DOCKER_IMAGE_VERSION := "20260809.dev1"
default: (trx-build-win "debug")
_docker_push tag:
docker push {{tag}}:{{DOCKER_IMAGE_VERSION}}
_docker_build dockerfile tag force="0":
#!/usr/bin/env sh
full_tag="{{tag}}:{{DOCKER_IMAGE_VERSION}}"
if [ "{{force}}" = "0" ]; then
docker images --format '{''{.Repository}}:{''{.Tag}}' | grep '^'"$full_tag"'$' >/dev/null
if [ $? -eq 0 ]; then
echo "Docker image $full_tag found"
exit 0
fi
echo "Docker image $full_tag not found, trying to download from DockerHub"
if docker pull $full_tag; then
echo "Docker image $full_tag downloaded from DockerHub"
exit 0
fi
echo "Docker image $full_tag not found, trying to build"
fi
echo "Building Docker image: {{dockerfile}} → $full_tag"
docker build \
. \
-f {{dockerfile}} \
-t $full_tag
_docker_run tag *args:
#!/usr/bin/env sh
full_tag="{{tag}}:{{DOCKER_IMAGE_VERSION}}"
echo "Running docker image: $full_tag {{args}}"
docker run \
--rm \
--user \
{{HOST_USER_UID}}:{{HOST_USER_GID}} \
-e CCACHE_DIR \
-e CCACHE_BASEDIR \
-e CCACHE_COMPILERCHECK \
-e CCACHE_MAXSIZE \
-v {{CWD}}:/app/ \
$full_tag \
{{args}}
image-win force="1": (_docker_build "tools/shared/docker/game-win/Dockerfile" "rrdash/trx-win" force)
image-linux force="1": (_docker_build "tools/shared/docker/game-linux/Dockerfile" "rrdash/trx-linux" force)
image-win-installer force="1": (_docker_build "tools/shared/docker/installer/Dockerfile" "rrdash/trx-installer" force)
push-image-linux: (image-linux "0") (_docker_push "rrdash/trx-linux")
push-image-win: (image-win "0") (_docker_push "rrdash/trx-win")
download-assets tr_version='all':
tools/download_assets {{tr_version}}
output-release-name:
tools/output_release_name
output-current-version *args:
tools/get_version {{args}}
output-current-changelog *args:
tools/output_current_changelog {{args}}
output-package-name *args:
tools/output_package_name {{args}}
clean:
-find build/ -type f -delete
-find tools/ -type f \( -ipath '*/out/*' -or -ipath '*/bin/*' -or -ipath '*/obj/*' \) -delete
-find . -mindepth 1 -empty -type d -delete
[group('lint')]
lint:
prek -a
trx-build-linux target='debug': (image-linux "0") (_docker_run "rrdash/trx-linux" "build" "--target" target)
trx-build-win target='debug': (image-win "0") (_docker_run "rrdash/trx-win" "build" "--target" target)
trx-build-win-installer target='release' *args: \
(trx-build-win target) \
(_docker_run "rrdash/trx-win" "package" "-o" "tools/installer/TRX_Installer/Resources/release.zip") \
(image-win-installer "0") \
(_docker_run "rrdash/trx-installer")
trx-package-linux target='debug' *args: (trx-build-linux target) (_docker_run "rrdash/trx-linux" "package" args)
trx-package-win target='debug' *args: (trx-build-win target) (_docker_run "rrdash/trx-win" "package" args)
trx-package-win-te artifact_path output *args:
python3 tools/lint/gen/te_symlinks
python3 tools/package_te_bundle.py --artifact {{artifact_path}} --output {{output}} {{args}}
trx-package-win-installer target='release' *args: \
(trx-build-win-installer target args) \
(_docker_run "rrdash/trx-win" "package" "--platform" "win-installer" args)
# Run the unit tests. The tests are a separate meson project.
[group('test')]
test *args='--suite unit':
#!/usr/bin/env sh
meson setup build/tests src/tests >/dev/null 2>&1 || meson setup --reconfigure build/tests src/tests >/dev/null
meson test -C build/tests --print-errorlogs {{args}}
# Regenerate the Lua API reference from a built binary.
[group('lint')]
lua-api-dump binary='build/trx/linux/TRX':
tools/lint/gen/lua_docs --dump-from {{binary}}
# CI guard: fail if the committed Lua API docs or api.json are stale.
[group('lint')]
lua-api-check binary='build/trx/linux/TRX': (lua-api-dump binary)
@git diff --exit-code -- docs/trx/lua/ || ( \
echo 'Lua API docs are stale. Run `just lua-api-dump` and commit the result.'; \
exit 1 )