wasmbuild.bat 908 B

12345678910111213141516171819202122232425262728293031
  1. @ECHO OFF
  2. CALL :Stage chapter-01-hellorust
  3. CALL :Stage chapter-02-helloecs
  4. CALL :Stage chapter-03-walkmap
  5. CALL :Stage chapter-04-newmap
  6. CALL :Stage chapter-05-fov
  7. CALL :Stage chapter-06-monsters
  8. CALL :Stage chapter-07-damage
  9. CALL :Stage chapter-08-ui
  10. CALL :Stage chapter-09-items
  11. CALL :Stage chapter-10-ranged
  12. CALL :Stage chapter-11-loadsave
  13. CALL :Stage chapter-12-delvingdeeper
  14. REM Publish or perish
  15. cd book\book\wasm
  16. pscp -r * herbert@172.16.10.193:/var/www/bfnightly/rustbook/wasm
  17. cd ..\..\..
  18. EXIT /B 0
  19. REM Usage: Stage Chapter
  20. :Stage
  21. cd %~1
  22. cargo build --release --target wasm32-unknown-unknown
  23. wasm-bindgen ..\target\wasm32-unknown-unknown\release\%~1.wasm --out-dir ../book/book/wasm/%~1 --no-modules --no-typescript
  24. cd ..
  25. move .\book\book\wasm\%~1\%~1.js .\book\book\wasm\%~1\myblob.js
  26. move .\book\book\wasm\%~1\%~1_bg.wasm ./book/book/wasm/%~1/myblob_bg.wasm
  27. copy index.html .\book\book\wasm\%~1