build: split justfile into smaller files; add groups

This commit is contained in:
Marcin Kurczewski 2025-03-31 00:25:02 +02:00
parent 12661fe6e6
commit e048bad1b6
3 changed files with 85 additions and 46 deletions

View file

@ -38,52 +38,8 @@ _docker_run *args:
-v {{CWD}}:/app/ \ -v {{CWD}}:/app/ \
{{args}} {{args}}
import "justfile.tr1"
tr1-image-linux force="1": (_docker_build "tools/tr1/docker/game-linux/Dockerfile" "rrdash/tr1x-linux" force) import "justfile.tr2"
tr1-image-win force="1": (_docker_build "tools/tr1/docker/game-win/Dockerfile" "rrdash/tr1x" force)
tr1-image-win-config force="1": (_docker_build "tools/tr1/docker/config/Dockerfile" "rrdash/tr1x-config" force)
tr1-image-win-installer force="1": (_docker_build "tools/tr1/docker/installer/Dockerfile" "rrdash/tr1x-installer" force)
tr1-push-image-linux: (tr1-image-linux "0") (_docker_push "rrdash/tr1x-linux")
tr1-push-image-win: (tr1-image-win "0") (_docker_push "rrdash/tr1x")
tr1-build-linux target='debug': (tr1-image-linux "0") (_docker_run "-e" "TARGET="+target "rrdash/tr1x-linux")
tr1-build-win target='debug': (tr1-image-win "0") (_docker_run "-e" "TARGET="+target "rrdash/tr1x")
tr1-build-win-config: (tr1-image-win-config "0") (_docker_run "rrdash/tr1x-config")
tr1-build-win-installer: (tr1-image-win-installer "0") (_docker_run "rrdash/tr1x-installer")
tr1-package-linux target='release': (tr1-build-linux target) (_docker_run "rrdash/tr1x-linux" "package")
tr1-package-win target='release': (tr1-build-win target) (_docker_run "rrdash/tr1x" "package")
tr1-package-win-all target='release': (tr1-build-win target) (tr1-build-win-config) (_docker_run "rrdash/tr1x" "package")
tr1-package-win-installer target='release': (tr1-build-win target) (tr1-build-win-config) (_docker_run "rrdash/tr1x" "package" "-o" "tools/installer/TR1X_Installer/Resources/release.zip") (tr1-build-win-installer)
#!/bin/sh
git checkout "tools/installer/TR1X_Installer/Resources/release.zip"
exe_name=TR1X-$(tools/get_version 1)-Installer.exe
cp tools/installer/out/TR1X_Installer.exe "${exe_name}"
echo "Created ${exe_name}"
tr2-image-linux force="1": (_docker_build "tools/tr2/docker/game-linux/Dockerfile" "rrdash/tr2x-linux" force)
tr2-image-win force="1": (_docker_build "tools/tr2/docker/game-win/Dockerfile" "rrdash/tr2x" force)
tr2-image-win-config force="1": (_docker_build "tools/tr2/docker/config/Dockerfile" "rrdash/tr2x-config" force)
tr2-image-win-installer force="1": (_docker_build "tools/tr2/docker/installer/Dockerfile" "rrdash/tr2x-installer" force)
tr2-push-image-linux: (tr2-image-linux "0") (_docker_push "rrdash/tr2x-linux")
tr2-push-image-win: (tr2-image-win "0") (_docker_push "rrdash/tr2x")
tr2-build-linux target='debug': (tr2-image-linux "0") (_docker_run "-e" "TARGET="+target "rrdash/tr2x-linux")
tr2-build-win target='debug': (tr2-image-win "0") (_docker_run "-e" "TARGET="+target "rrdash/tr2x")
tr2-build-win-config: (tr2-image-win-config "0") (_docker_run "rrdash/tr2x-config")
tr2-build-win-installer: (tr2-image-win-installer "0") (_docker_run "rrdash/tr2x-installer")
tr2-package-linux target='release': (tr2-build-linux target) (_docker_run "rrdash/tr2x-linux" "package")
tr2-package-win target='release': (tr2-build-win target) (_docker_run "rrdash/tr2x" "package")
tr2-package-win-all target='release': (tr2-build-win target) (tr2-build-win-config) (_docker_run "rrdash/tr2x" "package")
tr2-package-win-installer target='release': (tr2-build-win target) (tr2-build-win-config) (_docker_run "rrdash/tr2x" "package" "-o" "tools/installer/TR2X_Installer/Resources/release.zip") (tr2-build-win-installer)
#!/bin/sh
git checkout "tools/installer/TR2X_Installer/Resources/release.zip"
exe_name=TR2X-$(tools/get_version 1)-Installer.exe
cp tools/installer/out/TR2X_Installer.exe "${exe_name}"
echo "Created ${exe_name}"
output-release-name tr_version: output-release-name tr_version:
tools/output_release_name {{tr_version}} tools/output_release_name {{tr_version}}
@ -99,10 +55,13 @@ clean:
-find tools/ -type f \( -ipath '*/out/*' -or -ipath '*/bin/*' -or -ipath '*/obj/*' \) -delete -find tools/ -type f \( -ipath '*/out/*' -or -ipath '*/bin/*' -or -ipath '*/obj/*' \) -delete
-find . -mindepth 1 -empty -type d -delete -find . -mindepth 1 -empty -type d -delete
[group('lint')]
lint-imports: lint-imports:
tools/sort_imports tools/sort_imports
[group('lint')]
lint-format: lint-format:
pre-commit run -a pre-commit run -a
[group('lint')]
lint: (lint-imports) (lint-format) lint: (lint-imports) (lint-format)

41
justfile.tr1 Normal file
View file

@ -0,0 +1,41 @@
[group('tr1')]
tr1-image-linux force="1": (_docker_build "tools/tr1/docker/game-linux/Dockerfile" "rrdash/tr1x-linux" force)
[group('tr1')]
tr1-image-win force="1": (_docker_build "tools/tr1/docker/game-win/Dockerfile" "rrdash/tr1x" force)
[group('tr1')]
tr1-image-win-config force="1": (_docker_build "tools/tr1/docker/config/Dockerfile" "rrdash/tr1x-config" force)
[group('tr1')]
tr1-image-win-installer force="1": (_docker_build "tools/tr1/docker/installer/Dockerfile" "rrdash/tr1x-installer" force)
[group('tr1')]
tr1-push-image-linux: (tr1-image-linux "0") (_docker_push "rrdash/tr1x-linux")
[group('tr1')]
tr1-push-image-win: (tr1-image-win "0") (_docker_push "rrdash/tr1x")
[group('tr1')]
tr1-build-linux target='debug': (tr1-image-linux "0") (_docker_run "-e" "TARGET="+target "rrdash/tr1x-linux")
[group('tr1')]
tr1-build-win target='debug': (tr1-image-win "0") (_docker_run "-e" "TARGET="+target "rrdash/tr1x")
[group('tr1')]
tr1-build-win-config: (tr1-image-win-config "0") (_docker_run "rrdash/tr1x-config")
[group('tr1')]
tr1-build-win-installer: (tr1-image-win-installer "0") (_docker_run "rrdash/tr1x-installer")
[group('tr1')]
tr1-package-linux target='release': (tr1-build-linux target) (_docker_run "rrdash/tr1x-linux" "package")
[group('tr1')]
tr1-package-win target='release': (tr1-build-win target) (_docker_run "rrdash/tr1x" "package")
[group('tr1')]
tr1-package-win-all target='release': (tr1-build-win target) (tr1-build-win-config) (_docker_run "rrdash/tr1x" "package")
[group('tr1')]
tr1-package-win-installer target='release': \
(tr1-build-win target) \
(tr1-build-win-config) \
(_docker_run "rrdash/tr1x" "package" "-o" "tools/installer/TR1X_Installer/Resources/release.zip") \
(tr1-build-win-installer)
#!/bin/sh
git checkout "tools/installer/TR1X_Installer/Resources/release.zip"
exe_name=TR1X-$(tools/get_version 1)-Installer.exe
cp tools/installer/out/TR1X_Installer.exe "${exe_name}"
echo "Created ${exe_name}"

39
justfile.tr2 Normal file
View file

@ -0,0 +1,39 @@
[group('tr2')]
tr2-image-linux force="1": (_docker_build "tools/tr2/docker/game-linux/Dockerfile" "rrdash/tr2x-linux" force)
[group('tr2')]
tr2-image-win force="1": (_docker_build "tools/tr2/docker/game-win/Dockerfile" "rrdash/tr2x" force)
[group('tr2')]
tr2-image-win-config force="1": (_docker_build "tools/tr2/docker/config/Dockerfile" "rrdash/tr2x-config" force)
[group('tr2')]
tr2-image-win-installer force="1": (_docker_build "tools/tr2/docker/installer/Dockerfile" "rrdash/tr2x-installer" force)
[group('tr2')]
tr2-push-image-linux: (tr2-image-linux "0") (_docker_push "rrdash/tr2x-linux")
[group('tr2')]
tr2-push-image-win: (tr2-image-win "0") (_docker_push "rrdash/tr2x")
[group('tr2')]
tr2-build-linux target='debug': (tr2-image-linux "0") (_docker_run "-e" "TARGET="+target "rrdash/tr2x-linux")
[group('tr2')]
tr2-build-win target='debug': (tr2-image-win "0") (_docker_run "-e" "TARGET="+target "rrdash/tr2x")
[group('tr2')]
tr2-build-win-config: (tr2-image-win-config "0") (_docker_run "rrdash/tr2x-config")
[group('tr2')]
tr2-build-win-installer: (tr2-image-win-installer "0") (_docker_run "rrdash/tr2x-installer")
[group('tr2')]
tr2-package-linux target='release': (tr2-build-linux target) (_docker_run "rrdash/tr2x-linux" "package")
[group('tr2')]
tr2-package-win target='release': (tr2-build-win target) (_docker_run "rrdash/tr2x" "package")
[group('tr2')]
tr2-package-win-all target='release': (tr2-build-win target) (tr2-build-win-config) (_docker_run "rrdash/tr2x" "package")
[group('tr2')]
tr2-package-win-installer target='release': \
(tr2-build-win target) \
(tr2-build-win-config) \
(_docker_run "rrdash/tr2x" "package" "-o" "tools/installer/TR2X_Installer/Resources/release.zip") (tr2-build-win-installer)
#!/bin/sh
git checkout "tools/installer/TR2X_Installer/Resources/release.zip"
exe_name=TR2X-$(tools/get_version 1)-Installer.exe
cp tools/installer/out/TR2X_Installer.exe "${exe_name}"
echo "Created ${exe_name}"