From 61a1052b3e7a477f7abfcbc5e28948bb4d95ec61 Mon Sep 17 00:00:00 2001 From: ZennDev1337 Date: Wed, 16 Aug 2023 14:46:00 +0200 Subject: [PATCH] added a doc command to the run script --- Project/game/src/lib.rs | 3 --- run | 5 ++++- run.bat | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Project/game/src/lib.rs b/Project/game/src/lib.rs index fb6c97c..ff15aa6 100644 --- a/Project/game/src/lib.rs +++ b/Project/game/src/lib.rs @@ -1,9 +1,6 @@ #![no_std] #![allow(non_upper_case_globals)] -#[no_mangle] -pub static ArduboyTones_Library: u8 = 1; - //Include the Arduboy Library #[allow(unused_imports)] use arduboy_rust::prelude::*; diff --git a/run b/run index 0c90c6c..15ea40d 100755 --- a/run +++ b/run @@ -4,7 +4,10 @@ option=$1 if [ -z "$option" ] then - cargo build -p game --release && cp ./target/arduboy/release/libgame.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/game.hex && pio run -t clean && rm lib/libgame.a && cd .. + cargo doc -p arduboy-rust && rm -r ./docs/doc/ && cp -r ./target/arduboy/doc ./docs/ +elif [ "$option" = "doc" ] +then + cargo build -p snake --release && cp ./target/arduboy/release/libsnake.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/snake.hex && pio run -t clean && rm lib/libgame.a && cd .. elif [ "$option" = "snake" ] then cargo build -p snake --release && cp ./target/arduboy/release/libsnake.a ./Wrapper-Project/lib/libgame.a && cd Wrapper-Project/ && pio run -v -t upload && cp ./.pio/build/arduboy/firmware.hex ./.pio/build/snake.hex && pio run -t clean && rm lib/libgame.a && cd .. diff --git a/run.bat b/run.bat index a36797a..353303f 100644 --- a/run.bat +++ b/run.bat @@ -9,6 +9,9 @@ if [%option%]==[] ( if %option%==snake ( goto :run +) else if %option%==doc ( + powershell -Command "cargo doc -p arduboy-rust; rm -r ./docs/doc/; cp -r ./target/arduboy/doc ./docs/" + goto :eof ) else if %option%==pong ( goto :run ) else if %option%==rustacean (