Rust-for-Arduboy/run.bat

52 lines
1.8 KiB
Batchfile
Raw Normal View History

2023-08-06 18:14:49 +02:00
@echo off
set option=%1
if [%option%]==[] (
powershell -Command "cargo build -p game --release; cp ./target/arduboy/release/libgame.a ./arduboy-rust/Wrapper-Project/lib/libgame.a; cd arduboy-rust/Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./build/game.hex; pio run -t clean; rm lib/libgame.a; cd ../../"
2023-08-06 18:14:49 +02:00
goto :eof
)
if %option%==snake (
goto :run
2023-08-16 14:46:00 +02:00
) else if %option%==doc (
powershell -Command "cargo doc -p arduboy-rust; rm -r ./docs/doc/; cp -r ./target/arduboy/doc ./docs/"
goto :eof
2023-08-06 18:14:49 +02:00
) else if %option%==pong (
goto :run
) else if %option%==drboy (
goto :run
2023-08-06 18:14:49 +02:00
) else if %option%==rustacean (
goto :run
2023-08-06 18:14:49 +02:00
) else if %option%==tone (
goto :run
2023-08-06 18:14:49 +02:00
) else if %option%==eeprom (
goto :run
) else if %option%==eeprom-byte (
powershell -Command "cargo build -p %option% --release; cp ./target/arduboy/release/libeeprom_byte.a ./arduboy-rust/Wrapper-Project/lib/libgame.a; cd arduboy-rust/Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./build/%option%.hex; pio run -t clean; rm lib/libgame.a; cd ../../"
goto :eof
) else if %option%==progmem (
goto :run
2023-08-06 18:14:49 +02:00
) else if %option%==demo2 (
goto :run
2023-08-06 18:14:49 +02:00
) else if %option%==demo3 (
goto :run
2023-08-06 18:14:49 +02:00
) else if %option%==demo4 (
goto :run
2023-08-06 18:14:49 +02:00
) else if %option%==demo5 (
goto :run
2023-08-06 18:14:49 +02:00
) else if %option%==demo6 (
goto :run
2023-09-04 09:22:04 +02:00
) else if %option%==demo7 (
goto :run
) else (
2023-09-11 09:24:37 +02:00
goto :run
2023-08-06 18:14:49 +02:00
)
:run
powershell -Command "cargo build -p %option% --release; cp ./target/arduboy/release/lib%option%.a ./arduboy-rust/Wrapper-Project/lib/libgame.a; cd arduboy-rust/Wrapper-Project/; pio run -v -t upload; cp ./.pio/build/arduboy/firmware.hex ./build/%option%.hex; pio run -t clean; rm lib/libgame.a; cd ../../"
goto :eof
:help
2023-08-06 18:14:49 +02:00
@echo Usage: .\run.bat // for uploading your game
@echo Usage: .\run.bat ^<Example Game^> // for uploading an example game