2023-06-11 20:26:45 +00:00
|
|
|
# configuration for https://github.com/sagiegurari/cargo-make
|
|
|
|
|
2020-12-06 15:27:26 +00:00
|
|
|
[config]
|
|
|
|
skip_core_tasks = true
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[env]
|
|
|
|
# all features except the backend ones
|
|
|
|
ALL_FEATURES = "all-widgets,macros,serde"
|
2020-12-06 15:27:26 +00:00
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.default]
|
|
|
|
alias = "ci"
|
2023-06-26 07:31:30 +00:00
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.ci]
|
2023-06-26 07:31:30 +00:00
|
|
|
dependencies = [
|
|
|
|
"style-check",
|
2023-07-17 10:31:31 +00:00
|
|
|
"clippy",
|
|
|
|
"check",
|
|
|
|
"test",
|
2023-06-26 07:31:30 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.style-check]
|
|
|
|
dependencies = ["fmt", "typos"]
|
|
|
|
|
|
|
|
[tasks.fmt]
|
|
|
|
toolchain = "nightly"
|
|
|
|
command = "cargo"
|
|
|
|
args = ["fmt", "--all", "--check"]
|
|
|
|
|
|
|
|
[tasks.typos]
|
|
|
|
install_crate = { crate_name = "typos-cli", binary = "typos", test_arg = "--version" }
|
|
|
|
command = "typos"
|
|
|
|
|
|
|
|
[tasks.check]
|
2020-12-06 15:27:26 +00:00
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"check",
|
|
|
|
"--all-targets",
|
2023-07-17 10:31:31 +00:00
|
|
|
"--all-features"
|
2020-12-06 15:27:26 +00:00
|
|
|
]
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.check.windows]
|
|
|
|
args = [
|
|
|
|
"check",
|
|
|
|
"--all-targets",
|
|
|
|
"--no-default-features", "--features", "${ALL_FEATURES},crossterm,termwiz"
|
2023-06-26 07:31:30 +00:00
|
|
|
]
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.build]
|
2020-12-06 15:27:26 +00:00
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"build",
|
|
|
|
"--all-targets",
|
2023-07-17 10:31:31 +00:00
|
|
|
"--all-features",
|
2020-12-06 15:27:26 +00:00
|
|
|
]
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.build.windows]
|
|
|
|
args = [
|
|
|
|
"build",
|
|
|
|
"--all-targets",
|
|
|
|
"--no-default-features", "--features", "${ALL_FEATURES},crossterm,termwiz"
|
2023-06-26 07:31:30 +00:00
|
|
|
]
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.clippy]
|
2020-12-06 15:27:26 +00:00
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"clippy",
|
2021-12-23 17:45:46 +00:00
|
|
|
"--all-targets",
|
2023-06-26 07:31:30 +00:00
|
|
|
"--tests",
|
|
|
|
"--benches",
|
2023-07-17 10:31:31 +00:00
|
|
|
"--all-features",
|
2020-12-06 15:27:26 +00:00
|
|
|
"--",
|
|
|
|
"-D",
|
|
|
|
"warnings",
|
|
|
|
]
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.clippy.window]
|
|
|
|
args = [
|
|
|
|
"clippy",
|
|
|
|
"--all-targets",
|
|
|
|
"--tests",
|
|
|
|
"--benches",
|
|
|
|
"--no-default-features", "--features", "${ALL_FEATURES},crossterm,termwiz",
|
|
|
|
"--",
|
|
|
|
"-D",
|
|
|
|
"warnings",
|
2023-06-26 07:31:30 +00:00
|
|
|
]
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.test]
|
2023-06-26 07:31:30 +00:00
|
|
|
dependencies = [
|
|
|
|
"test-doc",
|
|
|
|
]
|
2023-07-17 10:31:31 +00:00
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"test",
|
|
|
|
"--all-targets",
|
|
|
|
"--all-features",
|
|
|
|
]
|
|
|
|
|
2023-06-26 07:31:30 +00:00
|
|
|
|
|
|
|
[tasks.test-windows]
|
|
|
|
dependencies = [
|
|
|
|
"test-doc",
|
|
|
|
]
|
2023-07-17 10:31:31 +00:00
|
|
|
args = [
|
|
|
|
"test",
|
|
|
|
"--all-targets",
|
|
|
|
"--no-default-features", "--features", "${ALL_FEATURES},crossterm,termwiz"
|
|
|
|
]
|
2023-06-26 07:31:30 +00:00
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.test-doc]
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"test", "--doc",
|
|
|
|
"--all-features",
|
|
|
|
]
|
2021-11-11 14:56:37 +00:00
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
[tasks.test-doc.windows]
|
|
|
|
args = [
|
|
|
|
"test", "--doc",
|
|
|
|
"--no-default-features", "--features", "${ALL_FEATURES},crossterm,termwiz"
|
|
|
|
]
|
2023-05-12 15:58:01 +00:00
|
|
|
|
2023-06-26 07:31:30 +00:00
|
|
|
[tasks.test-backend]
|
2023-07-17 10:31:31 +00:00
|
|
|
# takes a command line parameter to specify the backend to test (e.g. "crossterm")
|
2020-12-06 15:27:26 +00:00
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"test",
|
2023-06-26 07:31:30 +00:00
|
|
|
"--all-targets",
|
2023-07-17 10:31:31 +00:00
|
|
|
"--no-default-features", "--features", "${ALL_FEATURES},${@}"
|
2021-11-11 14:56:37 +00:00
|
|
|
]
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
|
|
|
|
[tasks.coverage]
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"llvm-cov",
|
|
|
|
"--lcov",
|
|
|
|
"--output-path", "target/lcov.info",
|
|
|
|
"--all-features",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.coverage.windows]
|
2021-11-11 14:56:37 +00:00
|
|
|
command = "cargo"
|
2023-07-17 10:31:31 +00:00
|
|
|
args = [
|
|
|
|
"llvm-cov",
|
|
|
|
"--lcov",
|
|
|
|
"--output-path", "target/lcov.info",
|
|
|
|
"--no-default-features",
|
|
|
|
"--features", "${ALL_FEATURES},crossterm,termwiz",
|
|
|
|
]
|
2020-12-06 15:27:26 +00:00
|
|
|
|
2020-12-13 14:29:31 +00:00
|
|
|
[tasks.run-example]
|
|
|
|
private = true
|
2021-11-11 14:56:37 +00:00
|
|
|
condition = { env_set = ["TUI_EXAMPLE_NAME"] }
|
2020-12-13 14:29:31 +00:00
|
|
|
command = "cargo"
|
2023-06-11 20:26:45 +00:00
|
|
|
args = ["run", "--release", "--example", "${TUI_EXAMPLE_NAME}"]
|
2020-12-13 14:29:31 +00:00
|
|
|
|
|
|
|
[tasks.build-examples]
|
|
|
|
command = "cargo"
|
2023-06-11 20:26:45 +00:00
|
|
|
args = ["build", "--examples", "--release"]
|
2020-12-13 14:29:31 +00:00
|
|
|
|
|
|
|
[tasks.run-examples]
|
|
|
|
dependencies = ["build-examples"]
|
2020-12-06 15:27:26 +00:00
|
|
|
script = '''
|
2020-12-13 14:29:31 +00:00
|
|
|
#!@duckscript
|
|
|
|
files = glob_array ./examples/*.rs
|
|
|
|
for file in ${files}
|
|
|
|
name = basename ${file}
|
|
|
|
name = substring ${name} -3
|
|
|
|
set_env TUI_EXAMPLE_NAME ${name}
|
2021-11-11 14:56:37 +00:00
|
|
|
cm_run_task run-example
|
2020-12-13 14:29:31 +00:00
|
|
|
end
|
2020-12-06 15:27:26 +00:00
|
|
|
'''
|