From e048bad1b64a0e6d0dc9c8eae61188ba89177536 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Mon, 31 Mar 2025 00:25:02 +0200 Subject: [PATCH] build: split justfile into smaller files; add groups --- justfile | 51 +++++---------------------------------------------- justfile.tr1 | 41 +++++++++++++++++++++++++++++++++++++++++ justfile.tr2 | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 46 deletions(-) create mode 100644 justfile.tr1 create mode 100644 justfile.tr2 diff --git a/justfile b/justfile index 42fd71978..5a6c3f744 100644 --- a/justfile +++ b/justfile @@ -38,52 +38,8 @@ _docker_run *args: -v {{CWD}}:/app/ \ {{args}} - -tr1-image-linux force="1": (_docker_build "tools/tr1/docker/game-linux/Dockerfile" "rrdash/tr1x-linux" force) -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}" +import "justfile.tr1" +import "justfile.tr2" 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 . -mindepth 1 -empty -type d -delete +[group('lint')] lint-imports: tools/sort_imports +[group('lint')] lint-format: pre-commit run -a +[group('lint')] lint: (lint-imports) (lint-format) diff --git a/justfile.tr1 b/justfile.tr1 new file mode 100644 index 000000000..ae1428562 --- /dev/null +++ b/justfile.tr1 @@ -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}" diff --git a/justfile.tr2 b/justfile.tr2 new file mode 100644 index 000000000..7f040f5a7 --- /dev/null +++ b/justfile.tr2 @@ -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}"