Changed run tasks behavior

This commit is contained in:
Profitroll 2023-01-29 11:06:23 +01:00
parent e631d1717e
commit 3bab4faa46
9 changed files with 70 additions and 23 deletions

40
.vscode/tasks.json vendored
View File

@ -29,8 +29,8 @@
"dependsOn": ["Clean up"]
},
{
"label": "Run (Python)",
"detail": "Copy source code from 'src' dir into 'testpython' and start main.py within venv",
"label": "Run (Python) [Dirty]",
"detail": "Remove all cache files and start main.py within venv",
"type": "shell",
"windows": {
"command": "./.vscode/tasks/windows/run_python.bat"
@ -43,10 +43,27 @@
"isDefault": true
},
"problemMatcher": [],
"dependsOn": ["Clean up"]
},
{
"label": "Run (Python) [Clean]",
"detail": "Needs to be ran before the dirty version can be used. Copy source code from 'src' dir into 'testpython', install requirements and start main.py within venv",
"type": "shell",
"windows": {
"command": "./.vscode/tasks/windows/flush_and_run_python.bat"
},
"linux": {
"command": "bash ./.vscode/tasks/linux/flush_and_run_python.sh"
},
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": [],
"dependsOn": ["Clean up", "Install requirements"]
},
{
"label": "Run (Binary)",
"label": "Run (Binary) [Dirty]",
"detail": "Copy compiled binaries from 'dest/%os%' dir into 'testbinary/%os%' and start it",
"type": "shell",
"windows": {
@ -62,6 +79,23 @@
"problemMatcher": [],
"dependsOn": ["Build"]
},
{
"label": "Run (Binary) [Clean]",
"detail": "Needs to be ran before the dirty version can be used. Copy compiled binaries from 'dest/%os%' dir into 'testbinary/%os%' and start it",
"type": "shell",
"windows": {
"command": "./.vscode/tasks/windows/flush_and_run_binary.bat"
},
"linux": {
"command": "bash ./.vscode/tasks/linux/flush_and_run_binary.sh"
},
"group": {
"kind": "test",
"isDefault": false
},
"problemMatcher": [],
"dependsOn": ["Build"]
},
{
"label": "Configure Setup",
"detail": "Configure IF setup file on Windows and .deb package on Linux",

View File

@ -0,0 +1,12 @@
#!/bin/bash
rm -rf ./testbinary/linux
mkdir ./testbinary/linux
cp -r ./dist/linux/* ./testbinary/linux/
cd "testbinary/linux/"
chmod +x "StardewSync"
"./StardewSync"

View File

@ -0,0 +1,8 @@
#!/bin/bash
rm -rf testpython
mkdir testpython
cp -r ./src/* ./testpython/
source venv/bin/activate && cd ./testpython && python ./main.py && deactivate

View File

@ -1,10 +1,5 @@
#!/bin/bash
rm -rf ./testbinary/linux
mkdir ./testbinary/linux
cp -r ./dist/linux/* ./testbinary/linux/
cd "testbinary/linux/"
chmod +x "StardewSync"

View File

@ -1,8 +1,3 @@
#!/bin/bash
rm -rf testpython
mkdir testpython
cp -r ./src/* ./testpython/
source venv/bin/activate && cd ./testpython && python ./main.py && deactivate

View File

@ -0,0 +1,7 @@
rmdir /S /Q testbinary\windows
mkdir testbinary\windows
xcopy ".\dist\windows\" ".\testbinary\windows\" /h /i /c /k /e /r /y
cd ".\testbinary\windows\StardewSync"
".\StardewSync.exe"

View File

@ -0,0 +1,6 @@
rmdir /S /Q testpython
mkdir testpython
xcopy ".\src\" ".\testpython\" /h /i /c /k /e /r /y
venv\Scripts\activate && cd .\testpython && python .\main.py && deactivate

View File

@ -1,7 +1,2 @@
rmdir /S /Q testbinary\windows
mkdir testbinary\windows
xcopy ".\dist\windows\" ".\testbinary\windows\" /h /i /c /k /e /r /y
cd ".\testbinary\windows\StardewSync"
".\StardewSync.exe"

View File

@ -1,6 +1 @@
rmdir /S /Q testpython
mkdir testpython
xcopy ".\src\" ".\testpython\" /h /i /c /k /e /r /y
venv\Scripts\activate && cd .\testpython && python .\main.py && deactivate