2020-12-06 15:27:26 +00:00
|
|
|
[config]
|
|
|
|
skip_core_tasks = true
|
|
|
|
|
|
|
|
[env.TUI_FEATURES]
|
|
|
|
source = "${CARGO_MAKE_RUST_TARGET_OS}"
|
|
|
|
default_value = "unknown"
|
|
|
|
|
|
|
|
[env.TUI_FEATURES.mapping]
|
2021-11-01 21:27:46 +00:00
|
|
|
linux = "serde,crossterm,termion"
|
|
|
|
macos = "serde,crossterm,termion"
|
2020-12-06 15:27:26 +00:00
|
|
|
windows = "serde,crossterm"
|
|
|
|
|
|
|
|
[tasks.default]
|
|
|
|
dependencies = [
|
|
|
|
"check",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.ci]
|
|
|
|
dependencies = [
|
|
|
|
"fmt",
|
|
|
|
"check",
|
|
|
|
"test",
|
|
|
|
"clippy",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
[tasks.fmt]
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"fmt",
|
|
|
|
"--all",
|
|
|
|
"--",
|
|
|
|
"--check",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.check]
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"check",
|
|
|
|
"--no-default-features",
|
|
|
|
"--features",
|
|
|
|
"${TUI_FEATURES}",
|
|
|
|
"--all-targets",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.build]
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"build",
|
|
|
|
"--no-default-features",
|
|
|
|
"--features",
|
|
|
|
"${TUI_FEATURES}",
|
|
|
|
"--all-targets",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.clippy]
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"clippy",
|
|
|
|
"--no-default-features",
|
|
|
|
"--features",
|
|
|
|
"${TUI_FEATURES}",
|
|
|
|
"--",
|
|
|
|
"-D",
|
|
|
|
"warnings",
|
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.test]
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"test",
|
|
|
|
"--no-default-features",
|
|
|
|
"--features",
|
|
|
|
"${TUI_FEATURES}"
|
|
|
|
]
|
|
|
|
|
2020-12-13 14:29:31 +00:00
|
|
|
[tasks.run-example]
|
|
|
|
private = true
|
|
|
|
condition = { env_set = ["TUI_EXAMPLE_NAME", "TUI_FEATURES"] }
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"run",
|
|
|
|
"--features",
|
|
|
|
"${TUI_FEATURES}",
|
|
|
|
"--release",
|
|
|
|
"--example",
|
|
|
|
"${TUI_EXAMPLE_NAME}"
|
|
|
|
]
|
|
|
|
|
|
|
|
[tasks.run-example-windows]
|
|
|
|
private = true
|
|
|
|
condition = { env = {"TUI_EXAMPLE_NAME" = "crossterm_demo"} }
|
|
|
|
run_task = "run-example"
|
|
|
|
|
|
|
|
[tasks.run-example-router]
|
|
|
|
private = true
|
|
|
|
run_task = [
|
|
|
|
{ name = "run-example-windows", condition = { platforms = ["window"] } },
|
|
|
|
{ name = "run-example" }
|
|
|
|
]
|
2020-12-06 15:27:26 +00:00
|
|
|
|
2020-12-13 14:29:31 +00:00
|
|
|
[tasks.build-examples]
|
|
|
|
condition = { env_set = ["TUI_FEATURES"] }
|
|
|
|
command = "cargo"
|
|
|
|
args = [
|
|
|
|
"build",
|
|
|
|
"--examples",
|
|
|
|
"--features",
|
|
|
|
"${TUI_FEATURES}",
|
|
|
|
"--release"
|
|
|
|
]
|
|
|
|
|
|
|
|
[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}
|
|
|
|
cm_run_task run-example-router
|
|
|
|
end
|
2020-12-06 15:27:26 +00:00
|
|
|
'''
|