From a37196ab22bbb76ab9b7ccaf0291712878183ac7 Mon Sep 17 00:00:00 2001 From: Profitroll <47523801+profitrollgame@users.noreply.github.com> Date: Fri, 27 Jan 2023 16:09:07 +0100 Subject: [PATCH] And one more tasks update --- .vscode/tasks.json | 22 +++++++++++++++++++ .vscode/tasks/linux/cleanup_everything.sh | 13 +++++++++++ .../tasks/linux/install_build_requirements.sh | 7 ++++++ .vscode/tasks/windows/cleanup_everything.bat | 11 ++++++++++ .../windows/install_build_requirements.bat | 5 +++++ 5 files changed, 58 insertions(+) create mode 100644 .vscode/tasks/linux/cleanup_everything.sh create mode 100644 .vscode/tasks/linux/install_build_requirements.sh create mode 100644 .vscode/tasks/windows/cleanup_everything.bat create mode 100644 .vscode/tasks/windows/install_build_requirements.bat diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 48a0a9e..a86a4c4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -14,6 +14,17 @@ }, "problemMatcher": [] }, + { + "label": "Clean up everything", + "type": "shell", + "windows": { + "command": "./.vscode/tasks/windows/cleanup_everything.bat" + }, + "linux": { + "command": "bash ./.vscode/tasks/linux/cleanup_everything.sh" + }, + "problemMatcher": [] + }, { "label": "Build", "type": "shell", @@ -48,6 +59,17 @@ }, "problemMatcher": [] }, + { + "label": "Install build requirements", + "type": "shell", + "windows": { + "command": "./.vscode/tasks/windows/install_build_requirements.bat" + }, + "linux": { + "command": "bash ./.vscode/tasks/linux/install_build_requirements.sh" + }, + "problemMatcher": [] + }, { "label": "Install requirements", "type": "shell", diff --git a/.vscode/tasks/linux/cleanup_everything.sh b/.vscode/tasks/linux/cleanup_everything.sh new file mode 100644 index 0000000..d967329 --- /dev/null +++ b/.vscode/tasks/linux/cleanup_everything.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +python -Bc "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.py[co]')]" +python -Bc "import pathlib; [p.rmdir() for p in pathlib.Path('.').rglob('__pycache__')]" + +rm -rf build/linux/* +rm -rf build/windows/* + +rm -rf dist/linux/app +rm -rf dist/windows/app + +rm -rf venv +rm -rf buildenv \ No newline at end of file diff --git a/.vscode/tasks/linux/install_build_requirements.sh b/.vscode/tasks/linux/install_build_requirements.sh new file mode 100644 index 0000000..36ce3bb --- /dev/null +++ b/.vscode/tasks/linux/install_build_requirements.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +pip install virtualenv + +virtualenv buildenv + +buildenv/Scripts/activate && pip install --upgrade Pyinstaller && pip install --upgrade -r requirements.txt && deactivate \ No newline at end of file diff --git a/.vscode/tasks/windows/cleanup_everything.bat b/.vscode/tasks/windows/cleanup_everything.bat new file mode 100644 index 0000000..9fa00c1 --- /dev/null +++ b/.vscode/tasks/windows/cleanup_everything.bat @@ -0,0 +1,11 @@ +python -Bc "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.py[co]')]" +python -Bc "import pathlib; [p.rmdir() for p in pathlib.Path('.').rglob('__pycache__')]" + +rmdir /S /Q build\linux\* +rmdir /S /Q build\windows\* + +rmdir /S /Q dist\linux\app +rmdir /S /Q dist\windows\app + +rmdir /S /Q venv +rmdir /S /Q buildenv \ No newline at end of file diff --git a/.vscode/tasks/windows/install_build_requirements.bat b/.vscode/tasks/windows/install_build_requirements.bat new file mode 100644 index 0000000..5bb2763 --- /dev/null +++ b/.vscode/tasks/windows/install_build_requirements.bat @@ -0,0 +1,5 @@ +pip install virtualenv + +virtualenv buildenv + +buildenv\Scripts\activate && pip install --upgrade Pyinstaller && pip install --upgrade -r requirements.txt && deactivate \ No newline at end of file