aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-05-26 13:35:28 +0000
committerFuwn <[email protected]>2025-05-26 13:35:28 +0000
commitb7b664c6b93d767dff584f96de4443bd5b50a008 (patch)
tree26d3a1ad9a26cdd928f3eba67cc4577ef4cb4488
parentchore(git): Update ignored files (diff)
downloadwindmark-b7b664c6b93d767dff584f96de4443bd5b50a008.tar.xz
windmark-b7b664c6b93d767dff584f96de4443bd5b50a008.zip
chore: Migrate to just from cargo-make
-rw-r--r--.gitignore3
-rw-r--r--Makefile.toml93
-rw-r--r--justfile50
3 files changed, 53 insertions, 93 deletions
diff --git a/.gitignore b/.gitignore
index 4c57fd6..e6dda0a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,6 @@ Cargo.lock
# macOS
.DS_Store
+
+# Fuwn/justfiles
+*.just
diff --git a/Makefile.toml b/Makefile.toml
deleted file mode 100644
index 6a48185..0000000
--- a/Makefile.toml
+++ /dev/null
@@ -1,93 +0,0 @@
-[config]
-default_to_workspace = false
-
-[tasks.fmt]
-args = ["fmt"]
-command = "cargo"
-toolchain = "nightly"
-
-[tasks.check]
-args = [
- "check",
- "--no-default-features",
- "--features=logger,auto-deduce-mime,response-macros,${@}",
-]
-command = "cargo"
-toolchain = "nightly"
-
-[tasks.clippy]
-args = [
- "clippy",
- "--no-default-features",
- "--features=logger,auto-deduce-mime,response-macros,${@}",
-]
-command = "cargo"
-toolchain = "nightly"
-
-[tasks.test]
-args = [
- "test",
- "--no-default-features",
- "--features=logger,auto-deduce-mime,response-macros,${@}",
-]
-command = "cargo"
-
-[tasks.checkf]
-script = '''
-#!@shell
-
-cargo make fmt
-cargo make check tokio
-cargo make check async-std
-'''
-
-[tasks.checkfc]
-script = '''
-#!@shell
-
-cargo make fmt
-cargo make check tokio
-cargo make check async-std
-cargo make clippy tokio
-cargo make clippy async-std
-'''
-
-[tasks.genkey]
-command = "openssl"
-args = [
- "req",
- "-new",
- "-subj",
- "/CN=localhost",
- "-x509",
- "-newkey",
- "ec",
- "-pkeyopt",
- "ec_paramgen_curve:prime256v1",
- "-days",
- "365",
- "-nodes",
- "-out",
- "windmark_public.pem",
- "-keyout",
- "windmark_private.pem",
- "-inform",
- "pem",
-]
-
-[tasks.docs]
-workspace = false
-toolchain = "nightly"
-command = "cargo"
-args = ["doc", "--open", "--no-deps"]
-
-[tasks.example]
-script = '''
-#!@duckscript
-
-if is_empty ${2}
- exec cargo run --example ${1} --no-default-features --features=logger,auto-deduce-mime,response-macros,tokio
-else
- exec cargo run --example ${1} --no-default-features --features=logger,auto-deduce-mime,response-macros,${2}
-end
-'''
diff --git a/justfile b/justfile
new file mode 100644
index 0000000..f478a11
--- /dev/null
+++ b/justfile
@@ -0,0 +1,50 @@
+import? 'cargo.just'
+
+set allow-duplicate-recipes := true
+
+default-features := "--features=logger,auto-deduce-mime,response-macros,"
+
+default:
+ @just --list
+
+fetch:
+ curl https://raw.githubusercontent.com/Fuwn/justfiles/refs/heads/main/cargo.just > cargo.just
+
+fmt:
+ cargo +nightly fmt
+
+[private]
+generic-task task async-feature:
+ cargo +nightly {{ task }} --no-default-features \
+ {{ default-features }}{{ async-feature }}
+
+check async-feature:
+ @just generic-task check {{ async-feature }}
+
+clippy async-feature:
+ @just generic-task clippy {{ async-feature }}
+
+test async-feature:
+ @just generic-task test {{ async-feature }}
+
+checkf:
+ @just fmt
+ @just check tokio
+ @just check async-std
+
+checkfc:
+ @just checkf
+ @just clippy tokio
+ @just clippy async-std
+
+docs:
+ cargo +nightly doc --open --no-deps
+
+example example async-feature="tokio":
+ cargo run --example {{ example }} --no-default-features \
+ {{ default-features }}{{ async-feature }}
+
+gen-key:
+ openssl req -new -subj /CN=localhost -x509 -newkey ec -pkeyopt \
+ ec_paramgen_curve:prime256v1 -days 365 -nodes -out windmark_public.pem \
+ -keyout windmark_private.pem -inform pem