Library crate for common tasks when building rust projects. Intended for use with cargo-auto: automation tasks written in Rust language.
version: 0.7.33 date: 2022-05-11 author: Bestia.dev repository: Github
Hashtags: #rustlang #buildtool #developmenttool
In your rust project root directory (where the Cargo.toml is)
first install cargo-auto and generate a new helper project:
bash
cargo install cargo-auto
cargo auto new
In a new editor open the generated directory automation_tasks_rs
as an independent rust project. There is already this dependency in Cargo.toml
:
toml
cargo_auto_lib="0.7.27"
Preview the code and observe all the auto_*
functions from cargo_auto_lib
.
Example:
fn taskrelease() {
autosemverincrementpatch();
autocargotomltomd();
autolinesofcode("");
autobuild();
}
Go back to your main rust project.
Add markers to the beginning of README.md (don't copy the numbers 1 and 2):
md
1 [comment]: # (auto_cargo_toml_to_md start)
2 [comment]: # (auto_cargo_toml_to_md end)
Run (in your main rust project):
bash
cargo auto release
With a little luck, it included the data of Cargo.toml into the README.md
inside the markers:
All the functions have extensive help/docs to describe how they work.
It is nice when you use a code editor with IntelliSense like VSCode.
This crate will attempt to edit Cargo.toml. Unfortunately there's no great robust way right now to edit TOML file preserving formatting and comments and such, so right now I use just regex to do this. If you find that the heuristics don't work for you though please let me know and I'll try to check in a fix!
I needed to copy large text into doc comments.
It means every line must get a prefix like ///
.
In VSCode I selected the text, press
alt+shift+i
Now I have multiple cursors
on the end of every selected lines.
I press the key
home
And now I have multiple cursors on the beginning of every line.
I type (insert):
///
and it's done ! Great !
Automate badges for crates.io, doc.rs, lib.rs, license, crev review. Check if they exist and create badges.
We live in times of danger with supply chain attacks.
It is recommended to always use cargo-crev
to verify the trustworthiness of each of your dependencies.
Please, spread this info.
You can also read reviews quickly on the web:
https://web.crev.dev/rust-reviews/crates/
My open-source projects are free as a beer (MIT license).
I just love programming.
But I need also to drink. If you find my projects and tutorials helpful,
please buy me a beer donating on my paypal.
You know the price of a beer in your local bar ;-)
So I can drink a free beer for your health :-)
Na zdravje! Alla salute! Prost! Nazdravlje! 🍻