Crates.io | cargo-merge |
lib.rs | cargo-merge |
version | 0.2.2 |
source | src |
created_at | 2021-02-04 12:10:48.536796 |
updated_at | 2021-04-26 13:23:52.673577 |
description | A cargo subcommand to merge the source code of a crate into a single file. |
homepage | https://gitlab.com/jfaixo/cargo-merge |
repository | https://gitlab.com/jfaixo/cargo-merge.git |
max_upload_size | |
id | 350474 |
size | 30,328 |
A cargo subcommand that merges your crate source code into a single file.
The initial purpose of this command is to merge your whole crate as a single source file that can be used on competitive programming platforms.
It works by expanding module imports by detecting them with regex, rewriting some "use" statements in the process.
my-crate = { path = "path/to/crate" }
)eprint!
and eprintln!
macrosWorking basic examples can be found in the integration tests data.
Just run the following command:
cargo install cargo-merge
Simply call the cargo sub command inside your crate folder hierarchy (it can be any folder below the one containing your Cargo.toml
file):
cargo merge
This will generate a merged file in target/merge/merged.rs
.
Long flag | Short flag | Description |
---|---|---|
-s |
--silence-standard-error-output |
Remove all the usages of eprint! and eprintln! macros from your code. |
This little project is heavily inspired by rust-sourcebundler. It has the same approach and has the same goal, but I find the cargo subcommand approach less intrusive. Also, I'll hopefully also maintain this project actively.