2021-03-26 19:01:22 +03:00
|
|
|
# Global Settings
|
|
|
|
[env]
|
|
|
|
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
|
2021-04-14 21:08:22 +03:00
|
|
|
CARGO_TARGET_DIR = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target"
|
2021-03-26 19:01:22 +03:00
|
|
|
SKIP_TEST = false
|
|
|
|
|
2021-04-13 20:14:13 +03:00
|
|
|
# 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",
|
|
|
|
]
|
|
|
|
|
2021-03-26 19:01:22 +03:00
|
|
|
# Patching the default flows to skip testing of wasm32-wasi targets
|
|
|
|
[tasks.pre-test]
|
|
|
|
condition = { env = { "CARGO_MAKE_CRATE_TARGET_TRIPLE" = "wasm32-wasi" } }
|
|
|
|
env = { "SKIP_TEST" = true }
|
|
|
|
|
|
|
|
[tasks.test]
|
|
|
|
condition = { env_false = ["SKIP_TEST"] }
|
|
|
|
dependencies = ["pre-test"]
|
2021-05-22 20:24:00 +03:00
|
|
|
args = ["test", "--", "@@split(CARGO_MAKE_TASK_ARGS,;)"]
|
2021-03-26 19:01:22 +03:00
|
|
|
|
|
|
|
[tasks.post-test]
|
|
|
|
env = { "SKIP_TEST" = false }
|
|
|
|
|
2021-04-14 21:08:22 +03:00
|
|
|
# Running Zellij using the development data directory
|
2021-03-30 14:49:42 +03:00
|
|
|
[tasks.run]
|
|
|
|
workspace = false
|
2021-04-14 21:08:22 +03:00
|
|
|
dependencies = ["build-workspace", "build-dev-data-dir"]
|
2021-04-01 14:18:05 +03:00
|
|
|
run_task = "launch"
|
|
|
|
|
|
|
|
[tasks.build-workspace]
|
|
|
|
run_task = { name = "build", fork = true }
|
2021-03-30 14:49:42 +03:00
|
|
|
|
2021-05-16 18:26:28 +03:00
|
|
|
[tasks.build]
|
2021-05-22 20:24:00 +03:00
|
|
|
args = ["build", "--", "@@split(CARGO_MAKE_TASK_ARGS,;)"]
|
2021-05-16 18:26:28 +03:00
|
|
|
|
|
|
|
[tasks.build-release]
|
2021-05-22 20:24:00 +03:00
|
|
|
args = ["build", "--release", "--", "@@split(CARGO_MAKE_TASK_ARGS,;)"]
|
2021-05-16 18:26:28 +03:00
|
|
|
|
2021-04-14 21:08:22 +03:00
|
|
|
[tasks.build-dev-data-dir]
|
2021-04-13 17:35:37 +03:00
|
|
|
script_runner = "@duckscript"
|
|
|
|
script = '''
|
2021-04-14 21:08:22 +03:00
|
|
|
asset_dir = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/assets
|
2021-04-19 21:11:15 +03:00
|
|
|
target_dir = set ${CARGO_TARGET_DIR}
|
2021-04-14 21:08:22 +03:00
|
|
|
data_dir = set ${target_dir}/dev-data
|
|
|
|
rm -r ${data_dir}
|
|
|
|
cp ${asset_dir}/layouts ${data_dir}/
|
|
|
|
plugins = glob_array ${target_dir}/wasm32-wasi/debug/*.wasm
|
|
|
|
for plugin in ${plugins}
|
|
|
|
plugin_name = basename ${plugin}
|
|
|
|
cp ${plugin} ${data_dir}/plugins/${plugin_name}
|
2021-04-13 17:35:37 +03:00
|
|
|
end
|
2021-04-14 21:08:22 +03:00
|
|
|
writefile ${data_dir}/VERSION ${CARGO_MAKE_CRATE_VERSION}
|
2021-04-13 17:35:37 +03:00
|
|
|
'''
|
|
|
|
|
2021-04-01 14:18:05 +03:00
|
|
|
[tasks.launch]
|
|
|
|
command = "cargo"
|
2021-04-19 21:11:15 +03:00
|
|
|
args = ["run", "--", "--data-dir", "${CARGO_TARGET_DIR}/dev-data/", "@@split(CARGO_MAKE_TASK_ARGS,;)"]
|
2021-03-30 14:49:42 +03:00
|
|
|
|
2021-04-13 17:35:37 +03:00
|
|
|
# Simple clippy tweak
|
|
|
|
[tasks.clippy]
|
|
|
|
args = ["clippy", "--", "@@split(CARGO_MAKE_TASK_ARGS,;)"]
|
|
|
|
|
|
|
|
# Release building and installing Zellij
|
|
|
|
[tasks.install]
|
|
|
|
workspace = false
|
2021-05-05 14:20:26 +03:00
|
|
|
dependencies = ["build-plugins-release", "wasm-opt-plugins", "build-release", "manpage"]
|
2021-04-13 17:35:37 +03:00
|
|
|
script_runner = "@duckscript"
|
|
|
|
script = '''
|
2021-04-16 18:50:35 +03:00
|
|
|
if is_dir ${CARGO_MAKE_TASK_ARGS}
|
|
|
|
trigger_error "You need to specify a full path for the binary, not just a directory!"
|
|
|
|
else
|
2021-04-19 21:11:15 +03:00
|
|
|
cp ${CARGO_TARGET_DIR}/release/${CARGO_MAKE_CRATE_NAME} ${CARGO_MAKE_TASK_ARGS}
|
2021-04-16 18:50:35 +03:00
|
|
|
end
|
2021-04-13 17:35:37 +03:00
|
|
|
'''
|
2021-03-26 19:01:22 +03:00
|
|
|
|
2021-04-20 01:37:47 +03:00
|
|
|
[tasks.build-plugins-release]
|
2021-04-13 17:35:37 +03:00
|
|
|
env = { "CARGO_MAKE_WORKSPACE_SKIP_MEMBERS" = ["."] }
|
|
|
|
run_task = { name = "build-release", fork = true }
|
2021-03-26 19:01:22 +03:00
|
|
|
|
2021-04-20 01:37:47 +03:00
|
|
|
[tasks.wasm-opt-plugins]
|
2021-04-13 17:35:37 +03:00
|
|
|
script_runner = "@duckscript"
|
|
|
|
script = '''
|
2021-04-20 01:37:47 +03:00
|
|
|
plugins = glob_array ${CARGO_TARGET_DIR}/wasm32-wasi/release/*.wasm
|
2021-03-26 19:01:22 +03:00
|
|
|
|
2021-04-20 01:37:47 +03:00
|
|
|
for plugin in ${plugins}
|
2021-04-29 17:52:22 +03:00
|
|
|
mkdir ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/assets/plugins/
|
2021-04-20 01:37:47 +03:00
|
|
|
plugin_name = basename ${plugin}
|
|
|
|
plugin_out = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/assets/plugins/${plugin_name}
|
2021-05-14 12:56:36 +03:00
|
|
|
if is_path_newer ${plugin} ${plugin_out} or not is_path_exists ${plugin_out}
|
2021-04-20 01:37:47 +03:00
|
|
|
exec wasm-opt -O ${plugin} -o ${plugin_out}
|
2021-04-13 17:35:37 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
'''
|
2021-03-26 19:01:22 +03:00
|
|
|
|
2021-05-05 14:20:26 +03:00
|
|
|
[tasks.manpage]
|
2021-05-07 07:57:45 +03:00
|
|
|
workspace = false
|
2021-05-05 14:20:26 +03:00
|
|
|
description = "Use mandown crate to create or update man entry from docs/MANPAGES.md"
|
2021-05-07 07:57:45 +03:00
|
|
|
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
|
|
|
|
'''
|
2021-05-05 15:16:53 +03:00
|
|
|
dependencies = ["install-mandown"]
|
|
|
|
|
|
|
|
[tasks.install-mandown]
|
|
|
|
command = "cargo"
|
|
|
|
args = ["install", "mandown"]
|
|
|
|
|
2021-04-19 21:11:15 +03:00
|
|
|
# CI Releasing Zellij
|
|
|
|
[tasks.ci-build-release]
|
|
|
|
workspace = false
|
2021-05-05 15:16:53 +03:00
|
|
|
dependencies = ["setup-cross-compilation", "build-plugins-release", "wasm-opt-plugins", "manpage"]
|
2021-04-27 01:33:53 +03:00
|
|
|
command = "cross"
|
2021-04-19 21:11:15 +03:00
|
|
|
args = ["build", "--verbose", "--release", "--target", "${CARGO_MAKE_TASK_ARGS}"]
|
|
|
|
|
2021-04-27 01:33:53 +03:00
|
|
|
[tasks.setup-cross-compilation]
|
|
|
|
command = "cargo"
|
|
|
|
args = ["install", "cross"]
|
|
|
|
|
2021-04-13 17:35:37 +03:00
|
|
|
# Publishing Zellij
|
|
|
|
[tasks.publish]
|
|
|
|
clear = true
|
|
|
|
workspace = false
|
2021-05-14 13:41:00 +03:00
|
|
|
dependencies = ["build-plugins-release", "wasm-opt-plugins", "release-commit", "build-release", "publish-zellij-tile", "publish-zellij-tile-utils"]
|
2021-04-14 21:26:12 +03:00
|
|
|
run_task = "publish-zellij"
|
2021-04-13 17:35:37 +03:00
|
|
|
|
2021-05-14 13:41:00 +03:00
|
|
|
[tasks.release-commit]
|
|
|
|
dependencies = ["commit-all", "tag-release"]
|
|
|
|
command = "git"
|
|
|
|
args = ["push", "--atomic", "origin", "main", "v${CARGO_MAKE_CRATE_VERSION}"]
|
|
|
|
|
|
|
|
[tasks.commit-all]
|
|
|
|
command = "git"
|
|
|
|
args = ["commit", "-aem", "chore(release): v${CARGO_MAKE_CRATE_VERSION}"]
|
|
|
|
|
|
|
|
[tasks.tag-release]
|
|
|
|
command = "git"
|
|
|
|
args = ["tag", "v${CARGO_MAKE_CRATE_VERSION}"]
|
|
|
|
|
2021-04-13 17:35:37 +03:00
|
|
|
[tasks.publish-zellij-tile]
|
2021-04-14 21:26:12 +03:00
|
|
|
ignore_errors = true
|
2021-04-13 17:35:37 +03:00
|
|
|
cwd = "zellij-tile"
|
|
|
|
command = "cargo"
|
|
|
|
args = ["publish"]
|
|
|
|
|
2021-05-05 01:31:30 +03:00
|
|
|
[tasks.publish-zellij-tile-utils]
|
2021-05-02 12:57:48 +03:00
|
|
|
ignore_errors = true
|
2021-05-05 01:31:30 +03:00
|
|
|
cwd = "zellij-tile-utils"
|
2021-05-02 12:57:48 +03:00
|
|
|
command = "cargo"
|
|
|
|
args = ["publish"]
|
|
|
|
|
2021-04-13 17:35:37 +03:00
|
|
|
[tasks.publish-zellij]
|
|
|
|
command = "cargo"
|
2021-05-04 21:50:27 +03:00
|
|
|
args = ["publish"]
|
|
|
|
|
2021-05-05 14:20:26 +03:00
|
|
|
|