cargo-make rust 任务执行以及构建工具
再学习nakago 框架的时候发现其使用了cargo-make 这个工具,但是很方便,类似make 的构建模式
包含的特性
依赖管理,别名支持,支持workspace
简单使用
- 安装
cargo install --force cargo-make
- 参考使用
创建一个cargo 项目
cargo new appdemo
Makefile.toml 文件
[tasks.format]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--emit=files"]
[tasks.clean]
command = "cargo"
args = ["clean"]
[tasks.build]
command = "cargo"
args = ["build"]
dependencies = ["clean"]
[tasks.test]
command = "cargo"
args = ["test"]
dependencies = ["clean"]
[tasks.my-flow]
dependencies = [
"format",
"build",
"test"
]
效果
- 运行
cargo make my-flow
效果
说明
对于golang 开发有一些实践是基于make cargo-make 工具可以让我们基于make 类似的模式进行开发管理,很值得使用下
参考资料
https://sagiegurari.github.io/cargo-make/
https://github.com/sagiegurari/cargo-make
https://github.com/bkonkle/nakago-simple-template/blob/main/template/Makefile.toml
https://sagiegurari.github.io/cargo-make/#usage-workspace-support
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2022-12-18 hydra snowflake 可选的olap postgres 数据库
2021-12-18 k8s集群部署几种方式
2021-12-18 webservice 动态调用使用技巧
2020-12-18 mojolicious perl web 框架简单试用
2020-12-18 explain.depesz.com 在线pg查询计划查看工具
2020-12-18 Vertically Scaling PostgreSQL
2020-12-18 gitpod 强大的快速提供开发环境的工具