zellij/Makefile.toml
Aram Drevekenin 79bf6ab868
feat(config): switch to kdl (#1759)
* chore(config): default kdl keybindings config

* tests

* work

* refactor(config): move stuff around

* work

* tab merge layout

* work

* work

* layouts working

* work

* layout tests

* work

* work

* feat(parsing): kdl layouts without config

* refactor(kdl): move stuff around

* work

* tests(layout): add cases and fix bugs

* work

* fix(kdl): various bugs

* chore(layouts): move all layouts to kdl

* feat(kdl): shared keybidns

* fix(layout): do not count fixed panes toward percentile

* fix(keybinds): missing keybinds and actions

* fix(config): adjust default tips

* refactor(config): move stuff around

* fix(tests): make e2e tests pass

* fix(kdl): add verbose parsing errors

* fix(kdl): focused tab

* fix(layout): corret default_tab_template behavior

* style(code): fix compile warnings

* feat(cli): send actions through the cli

* fix(cli): exit only when action is done

* fix(cli): open embedded pane from floating pane

* fix(cli): send actions to other sessions

* feat(cli): command alias

* feat(converter): convert old config

* feat(converter): convert old layout and theme files

* feat(kdl): pretty errors

* feat(client): convert old YAML files on startup

* fix: various bugs and styling issues

* fix: e2e tests

* fix(screen): propagate errors after merge

* style(clippy): lower clippy level

* fix(tests): own session_name variable

* style(fmt): rustfmt

* fix(cli): various action fixes

* style(fmt): rustfmt

* fix(themes): loading of theme files

* style(fmt): rustfmt

* fix(tests): theme fixtures

* fix(layouts): better errors on unknown nodes

* fix(kdl): clarify valid node terminator error

* fix(e2e): adjust close tab test

* fix(e2e): adjust close tab test again

* style(code): cleanup some comments
2022-10-05 07:44:00 +02:00

288 lines
7.0 KiB
TOML

# Global Settings
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_TARGET_DIR = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target"
SKIP_TEST = false
ZELLIJ_EXAMPLE_DIR = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/example"
ZELLIJ_ASSETS_DIR = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/zellij-utils/assets"
# Add clippy to the default flow
[tasks.dev-test-flow]
dependencies = [
"format-flow",
"format-toml-conditioned-flow",
"pre-build",
"build",
"post-build",
"test-flow",
"clippy",
]
[tasks.test]
dependencies = ["get-host-triple"]
args = ["test", "--target", "${CARGO_HOST_TRIPLE}", "--", "@@split(CARGO_MAKE_TASK_ARGS,;)"]
# Running Zellij using the development data directory
[tasks.run]
workspace = false
dependencies = ["build-workspace", "build-dev-data-dir"]
run_task = "launch"
[tasks.build-workspace]
run_task = { name = "build", fork = true }
[tasks.build]
args = ["build"]
[tasks.build-release]
args = ["build", "--release"]
[tasks.build-dev-data-dir]
dependencies = ["build-plugins"]
script_runner = "@duckscript"
script = '''
target_dir = set ${CARGO_TARGET_DIR}
data_dir = set ${target_dir}/dev-data
rm -r ${data_dir}
plugins = glob_array ${target_dir}/wasm32-wasi/debug/*.wasm
mkdir ${data_dir}
mkdir ${data_dir}/plugins
for plugin in ${plugins}
plugin_name = basename ${plugin}
cp ${plugin} ${data_dir}/plugins/${plugin_name}
end
writefile ${data_dir}/VERSION ${CARGO_MAKE_CRATE_VERSION}
'''
[tasks.build-e2e-data-dir]
dependencies = ["build-plugins-release"]
script_runner = "@duckscript"
script = '''
target_dir = set ${CARGO_TARGET_DIR}
data_dir = set ${target_dir}/e2e-data
rm -r ${data_dir}
plugins = glob_array ${target_dir}/wasm32-wasi/release/*.wasm
mkdir ${data_dir}
mkdir ${data_dir}/plugins
for plugin in ${plugins}
plugin_name = basename ${plugin}
cp ${plugin} ${data_dir}/plugins/${plugin_name}
end
writefile ${data_dir}/VERSION ${CARGO_MAKE_CRATE_VERSION}
'''
[tasks.launch]
command = "cargo"
args = [
"run",
"--",
"--data-dir",
"${CARGO_TARGET_DIR}/dev-data/",
"@@split(CARGO_MAKE_TASK_ARGS,;)",
]
# Simple clippy tweak
[tasks.clippy]
args = ["clippy", "--all-targets", "--all-features", "@@split(CARGO_MAKE_TASK_ARGS,;)"]
# Release building and installing Zellij
[tasks.install]
workspace = false
dependencies = ["wasm-opt-plugins", "build-release", "manpage"]
script_runner = "@duckscript"
script = '''
if is_dir ${CARGO_MAKE_TASK_ARGS}
trigger_error "You need to specify a full path for the binary, not just a directory!"
else
cp ${CARGO_TARGET_DIR}/release/${CARGO_MAKE_CRATE_NAME} ${CARGO_MAKE_TASK_ARGS}
end
'''
[tasks.build-plugins-release]
env = { "CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS" = [
"default-plugins/compact-bar",
"default-plugins/status-bar",
"default-plugins/strider",
"default-plugins/tab-bar",
] }
run_task = { name = "build-release", fork = true }
[tasks.build-plugins]
env = { "CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS" = [
"default-plugins/compact-bar",
"default-plugins/status-bar",
"default-plugins/strider",
"default-plugins/tab-bar",
] }
run_task = { name = "build", fork = true }
[tasks.get-host-triple]
script_runner = "@duckscript"
script = '''
output = exec rustc -v -V
lines = split ${output.stdout} \n
triple = set ""
for line in ${lines}
if starts_with ${line} "host:" && not is_empty ${line}
bits = split ${line} " "
triple = array_get ${bits} 1
triple = set ${triple}
end
end
if not is_empty ${triple}
set_env CARGO_HOST_TRIPLE "${triple}"
end
'''
[tasks.wasm-opt-plugins]
dependencies = ["build-plugins-release"]
script_runner = "@duckscript"
script = '''
plugins = glob_array ${CARGO_TARGET_DIR}/wasm32-wasi/release/*.wasm
for plugin in ${plugins}
mkdir ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/assets/plugins/
plugin_name = basename ${plugin}
plugin_out = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/assets/plugins/${plugin_name}
exec wasm-opt -O ${plugin} -o ${plugin_out}
end
'''
[tasks.manpage]
workspace = false
description = "Use mandown crate to create or update man entry from docs/MANPAGES.md"
script = '''
root_dir=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}
mkdir -p ${root_dir}/assets/man
mandown ${root_dir}/docs/MANPAGE.md ZELLIJ 1 > ${root_dir}/assets/man/zellij.1
'''
dependencies = ["install-mandown"]
[tasks.install-mandown]
command = "cargo"
args = ["install", "mandown"]
# copy the example default config from assets directory to a more user facing one
[tasks.update-default-config]
workspace = false
dependencies = []
script_runner = "@duckscript"
script = '''
cp ${ZELLIJ_ASSETS_DIR}/config/default.yaml ${ZELLIJ_EXAMPLE_DIR}/default.yaml
'''
# CI Releasing Zellij
[tasks.ci-build-release]
workspace = false
dependencies = [
"setup-cross-compilation",
"build-plugins-release",
"wasm-opt-plugins",
"manpage",
]
command = "cross"
args = [
"build",
"--verbose",
"--release",
"--target",
"${CARGO_MAKE_TASK_ARGS}",
]
# Build e2e asset
[tasks.build-e2e]
workspace = false
dependencies = ["build-plugins-release", "build-e2e-data-dir"]
command = "cargo"
args = [
"build",
"--verbose",
"--release",
"--target",
"x86_64-unknown-linux-musl",
]
# Run e2e tests - we mark the e2e tests as "ignored" so they will not be run with the normal ones
[tasks.e2e-test]
workspace = false
dependencies = ["build-e2e"]
command = "cargo"
args = [
"test",
"--",
"--ignored",
"--nocapture",
"--test-threads",
"1",
"@@split(CARGO_MAKE_TASK_ARGS,;)",
]
[tasks.setup-cross-compilation]
command = "cargo"
args = ["install", "cross"]
# Publishing Zellij
[tasks.publish]
clear = true
workspace = false
dependencies = [
"update-default-config",
"build-plugins-release",
"wasm-opt-plugins",
"release-commit",
]
run_task = "publish-zellij"
[tasks.release-commit]
dependencies = ["commit-all", "tag-release"]
command = "git"
args = ["push", "--atomic", "origin", "main", "v${CARGO_MAKE_CRATE_VERSION}"]
[tasks.commit-all]
ignore_errors = true
command = "git"
args = ["commit", "-aem", "chore(release): v${CARGO_MAKE_CRATE_VERSION}"]
[tasks.tag-release]
command = "git"
args = ["tag", "--annotate", "--message", "Version ${CARGO_MAKE_CRATE_VERSION}", "v${CARGO_MAKE_CRATE_VERSION}"]
[tasks.publish-zellij-tile]
ignore_errors = true
cwd = "zellij-tile"
script = "cargo publish && sleep 15"
[tasks.publish-zellij-client]
ignore_errors = true
dependencies = ["publish-zellij-utils"]
cwd = "zellij-client"
script = "cargo publish && sleep 15"
[tasks.publish-zellij-server]
ignore_errors = true
dependencies = ["publish-zellij-utils"]
cwd = "zellij-server"
script = "cargo publish && sleep 15"
[tasks.publish-zellij-utils]
ignore_errors = true
dependencies = ["publish-zellij-tile"]
cwd = "zellij-utils"
script = "cargo publish && sleep 15"
[tasks.publish-zellij-tile-utils]
ignore_errors = true
cwd = "zellij-tile-utils"
script = "cargo publish && sleep 15"
[tasks.publish-zellij]
dependencies = [
"publish-zellij-client",
"publish-zellij-server",
"publish-zellij-utils",
]
command = "cargo"
args = ["publish"]