98 lines
3.0 KiB
TOML
98 lines
3.0 KiB
TOML
[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_standalone]
|
|
extend = "build"
|
|
description = "Build client and server with musl libc embedded"
|
|
dependencies = ["build_client_release", "build_server_standalone"]
|
|
|
|
[tasks.build_client]
|
|
description = "Build client"
|
|
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
|
|
command = "wasm-pack"
|
|
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"
|
|
args = ["build", "app", "--target", "web", "--out-name", "app", "--out-dir", "../pslink/static/wasm/", "--release"]
|
|
|
|
[tasks.build_server]
|
|
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"]
|
|
|
|
[tasks.build_server_standalone]
|
|
extend = "build_server"
|
|
description = "Build server with the musl libc embedded"
|
|
args = ["build", "--package", "pslink", "--release", "--target", "x86_64-unknown-linux-musl"]
|
|
|
|
# ---- START ----
|
|
|
|
[tasks.start]
|
|
description = "Build and start the pslink server in debug mode"
|
|
command = "cargo"
|
|
args = ["run", "--package", "pslink", "--", "runserver"]
|
|
dependencies = ["build"]
|
|
|
|
[tasks.start_release]
|
|
extend = "start"
|
|
description = "Build and start the pslink server in release mode"
|
|
args = ["run", "--package", "pslink", "--release", "--", "runserver"]
|
|
dependencies = ["build_release"]
|
|
|
|
[tasks.start_standalone]
|
|
extend = "start"
|
|
description = "Build and start the pslink server with the musl c library embedded."
|
|
args = ["run", "--package", "pslink", "--release", "--", "runserver", "--target", "x86_64-unknown-linux-musl"]
|
|
dependencies = ["build_standalone"]
|
|
|
|
# ---- 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", "--",
|
|
"--warn", "warnings",
|
|
"--warn", "clippy::pedantic",
|
|
"--warn", "clippy::nursery",
|
|
"--allow", "clippy::future_not_send", # JS/WASM is single threaded
|
|
] |