Makefile.toml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. [env]
  2. # all workspace members can use this Makefile
  3. CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true"
  4. PORT = "8000"
  5. # ---- BUILD & CREATE WASMS ----
  6. [tasks.compile]
  7. description = "Build"
  8. workspace = false
  9. command = "cargo"
  10. args = ["build"]
  11. [tasks.compile_release]
  12. description = "Build, with the --release flag"
  13. workspace = false
  14. command = "cargo"
  15. args = ["build", "--release"]
  16. [tasks.create_wasm]
  17. description = "Build with wasm-pack"
  18. install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V", min_version = "0.8.0" }
  19. command = "wasm-pack"
  20. args = ["build", "--target", "web", "--out-name", "package", "--dev"]
  21. [tasks.create_wasm_release]
  22. description = "Build with wasm-pack"
  23. install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V", min_version = "0.8.0" }
  24. command = "wasm-pack"
  25. args = ["build", "--target", "web", "--out-name", "package"]
  26. [tasks.build]
  27. description = "Build, and create wasms"
  28. workspace = false
  29. dependencies = ["compile", "create_wasm"]
  30. [tasks.build_release]
  31. description = "Build, and create wasms, with the release flag"
  32. workspace = false
  33. dependencies = ["compile_release", "create_wasm_release"]
  34. [tasks.watch]
  35. description = "Build, create wasms, and watch/recompile files for changes"
  36. workspace = false
  37. dependencies = ["build", "create_wasm"]
  38. watch = { ignore_pattern="pkg/*" }
  39. [tasks.serve]
  40. description = "Start server"
  41. install_crate = { crate_name = "microserver", binary = "microserver", test_arg = "-h" }
  42. workspace = false
  43. command = "microserver"
  44. args = ["--port", "${PORT}"]
  45. [tasks.start]
  46. description = "Combine the build and serve tasks"
  47. workspace = false
  48. dependencies = ["build", "serve"]
  49. # ---- LINT ----
  50. [tasks.clippy]
  51. description = "Lint with Clippy"
  52. clear = true
  53. workspace = false
  54. install_crate = { rustup_component_name = "clippy", binary = "cargo-clippy", test_arg = "--help" }
  55. command = "cargo"
  56. args = ["clippy", "--all-features", "--", "--deny", "warnings", "--deny", "clippy::pedantic", "--deny", "clippy::nursery"]
  57. [tasks.fmt]
  58. description = "Format with rustfmt"
  59. workspace = false
  60. dependencies = ["fmt"]
  61. # ---- TEST ----
  62. [tasks.test]
  63. description = "Run tests. Ex: 'cargo make test firefox'. Test envs: [chrome, firefox, safari]"
  64. clear = true
  65. workspace = false
  66. install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V", min_version = "0.8.0" }
  67. command = "wasm-pack"
  68. args = ["test", "--${@}"]
  69. [tasks.test_release]
  70. extend = "test"
  71. description = "Run tests in release mode. Ex: 'cargo make test firefox'. Test envs: [chrome, firefox, safari]"
  72. args = ["test", "--${@}", "--release"]
  73. [tasks.test_h]
  74. description = "Run headless tests. Ex: 'cargo make test_h firefox'. Test envs: [chrome, firefox, safari]"
  75. extend = "test"
  76. args = ["test", "--headless", "--${@}"]
  77. [tasks.test_h_release]
  78. extend = "test_h"
  79. description = "Run headless tests in release mode. Ex: 'cargo make test_h firefox'. Test envs: [chrome, firefox, safari]"
  80. args = ["test", "--headless", "--${@}", "--release"]