Created batch files for building tools
This commit is contained in:
parent
37a7c582e7
commit
29ce5c4a77
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {},
|
||||||
|
"tasks": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "all",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./build_all.bat ${input:cargo cmd}",
|
||||||
|
"group": {
|
||||||
|
"kind": "build"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "cargo",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./run_cargo ${input:project} ${input:cargo cmd} ${input:build cfg}",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"id": "build cfg",
|
||||||
|
"type": "pickString",
|
||||||
|
"options": ["debug", "release"],
|
||||||
|
"default": "release",
|
||||||
|
"description": "build configuration"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "project",
|
||||||
|
"type": "pickString",
|
||||||
|
"options": ["cdtypes", "psxcdgen", "psxcdread"],
|
||||||
|
"description": "project to build"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "cargo cmd",
|
||||||
|
"type":"pickString",
|
||||||
|
"options": ["build", "check", "clean"],
|
||||||
|
"default": "build",
|
||||||
|
"description": "cargo command to run"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
@echo off
|
||||||
|
rem build_all [clean]
|
||||||
|
|
||||||
|
set bin_projects=psxcdgen psxcdread
|
||||||
|
set clean_projects=cdtypes
|
||||||
|
|
||||||
|
set projects=%bin_projects%
|
||||||
|
set build_type=build
|
||||||
|
set cur_dir=%cd%
|
||||||
|
|
||||||
|
IF NOT "%~1" == "" (
|
||||||
|
IF "%~1" == "clean" (
|
||||||
|
set build_type=clean
|
||||||
|
set projects=%projects% %clean_projects%
|
||||||
|
) ELSE (
|
||||||
|
set build_type=%~1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
for %%a in (%projects%) do (
|
||||||
|
call run_cargo %%a %build_type% release
|
||||||
|
cd %cur_dir%
|
||||||
|
)
|
|
@ -0,0 +1,31 @@
|
||||||
|
@echo off
|
||||||
|
rem run_cargo.bat project build|check|clean debug|release
|
||||||
|
|
||||||
|
set org_dir=%cd%
|
||||||
|
|
||||||
|
cd %1
|
||||||
|
IF %2 == build (
|
||||||
|
echo cargo build %1 --%3
|
||||||
|
cargo build --%3
|
||||||
|
IF %ERRORLEVEL% == 0 (
|
||||||
|
xcopy target\%3\%1.exe %org_dir%\..\..\bin /y
|
||||||
|
)
|
||||||
|
|
||||||
|
exit /B %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
IF %2 == check (
|
||||||
|
echo cargo check %1 --%3
|
||||||
|
cargo check --%3
|
||||||
|
|
||||||
|
exit /B %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
IF %2 == clean (
|
||||||
|
echo cargo clean %1
|
||||||
|
cargo clean
|
||||||
|
|
||||||
|
exit /B %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
echo "Unkown cargo command "%2" for project "%1"
|
Loading…
Reference in New Issue