wasmbuild.bat 692 B

123456789101112131415161718192021222324
  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. REM Publish or perish
  8. cd book\book\wasm
  9. pscp -r * herbert@172.16.10.193:/var/www/bfnightly/rustbook/wasm
  10. cd ..\..\..
  11. EXIT /B 0
  12. REM Usage: Stage Chapter
  13. :Stage
  14. cd %~1
  15. cargo build --release --target wasm32-unknown-unknown
  16. wasm-bindgen ..\target\wasm32-unknown-unknown\release\%~1.wasm --out-dir ../book/book/wasm/%~1 --no-modules --no-typescript
  17. cd ..
  18. move .\book\book\wasm\%~1\%~1.js .\book\book\wasm\%~1\myblob.js
  19. move .\book\book\wasm\%~1\%~1_bg.wasm ./book/book/wasm/%~1/myblob_bg.wasm
  20. copy index.html .\book\book\wasm\%~1