seed
seed copied to clipboard
cargo make clean
Clean all build artifacts from the Seed and examples by cargo make clean
.
See Makefile.toml
in the PR: https://github.com/seed-rs/seed/pull/523.
Well,
I am almost there :wink: .
# ---- CLEAN----
[tasks.clean]
description = "Clean only Seed"
command = "cargo"
args = ["clean"]
[tasks.clean_pkg]
description = "Generic Clean command"
command = "cargo"
args = ["clean","--target-dir" ,"pkg"]
[tasks.clean_examples]
description = "Clean all examples pkg"
command = "cargo"
args = ["make", "for_each", "clean_pkg"]
[tasks.clean_all]
description = "Clean all artifact in seed and examples"
dependencies = ["clean", "clean_examples"]
The script breaks for project that are build with /client
and /server
folders like https://github.com/seed-rs/seed/tree/master/examples/e2e_encryption
I guess I need to have a new code that differ from this in for_each
:
#!@duckscript
defined = is_defined 1
assert ${defined} "Wrong number of arguments! Correct example: 'cargo make for_each build'"
task = set ${1}
handle = glob_array examples/*/Makefile.toml
for path in ${handle}
example_root = dirname ${path}
echo Example root: ${example_root}
exec --fail-on-error cargo make --cwd ${example_root} ${task}
end
'''
]
Does somebody know how I could detect the folder /client
and change the target of it ? Or maybe there is a better solution like having a specific command for theses projects.
The way I handle this is that I have a Makefile in each server
and client
, and also one above each of those, calling both of their make commands: see here
[tasks.clean]
description = "Clean"
dependencies = ["clean_client", "clean_server"]
[tasks.clean_client]
command = "cargo"
args = ["make", "--cwd", "client", "clean"]
[tasks.clean_server]
command = "cargo"
args = ["make", "--cwd", "server", "clean"]
It might not be the most expandable method but it works for this pattern. Also you have dedicated Makefiles for each package.
But I guess you can easily make this use your for_each script.