Pslink/Makefile.toml

82 lines
2.4 KiB
Makefile
Raw Normal View History

[config]
default_to_workspace = false
# ---- BUILD ----
[tasks.build]
description = "Build client and server"
clear = true
dependencies = ["build_client", "build_server"]
[tasks.build_release]
extend = "build"
description = "Build client and server in release mode"
dependencies = ["build_client_release", "build_server_release"]
[tasks.build_client]
description = "Build client"
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
command = "wasm-pack"
2021-06-24 12:40:33 +02:00
args = ["build", "app", "--target", "web", "--out-name", "app", "--out-dir", "../pslink/static/wasm/", "--dev"]
[tasks.build_client_release]
extend = "build_client"
description = "Build client in release mode"
2021-06-24 12:40:33 +02:00
args = ["build", "app", "--target", "web", "--out-name", "app", "--out-dir", "../pslink/static/wasm/", "--release"]
[tasks.build_server]
2021-06-02 10:41:54 +02:00
env = { SQLX_OFFLINE = 1 }
description = "Build server"
command = "cargo"
args = ["build", "--package", "pslink"]
[tasks.build_server_release]
extend = "build_server"
description = "Build server in release mode"
args = ["build", "--package", "pslink", "--release"]
# ---- START ----
[tasks.start]
description = "Build and start Actix server with client on port 8000"
command = "cargo"
args = ["run", "--package", "pslink", "--", "runserver"]
dependencies = ["build"]
[tasks.start_release]
extend = "start"
description = "Build and start Actix server with client on port 8000 in release mode"
args = ["run", "--package", "pslink", "--release", "--", "runserver"]
dependencies = ["build_release"]
# ---- TEST ----
[tasks.test_firefox]
description = "Test with wasm-pack in Firefox"
command = "wasm-pack"
args = ["test", "client", "--firefox", "--headless"]
# ---- LINT ----
[tasks.fmt]
description = "Format with rustfmt"
install_crate = { crate_name = "rustfmt-nightly", rustup_component_name = "rustfmt", binary = "rustfmt", test_arg = "--help" }
command = "cargo"
args = ["fmt", "--all"]
[tasks.fmt_check]
extend = "fmt"
description = "Check format with rustfmt"
args = ["fmt", "--all", "--", "--check"]
[tasks.clippy]
description = "Lint with Clippy"
clear = true
install_crate = { rustup_component_name = "clippy", binary = "cargo-clippy", test_arg = "--help" }
command = "cargo"
args = ["clippy", "--all-features", "--",
2021-06-17 10:45:28 +02:00
"--warn", "warnings",
"--warn", "clippy::pedantic",
"--warn", "clippy::nursery",
"--allow", "clippy::future_not_send", # JS/WASM is single threaded
]