#cargo-subcommand #bundle #unify #write-file #cargo

nightly bin+lib cargo-unify

A tool to unify crates into single buildable files

5 releases

Uses new Rust 2024

0.1.5 Jan 20, 2025
0.1.4 Jan 20, 2025
0.1.2 Jan 18, 2025
0.1.1 Jan 18, 2025
0.1.0 Jan 18, 2025

#320 in Cargo plugins

MIT license

9KB
159 lines

cargo-unify

A tool to unify crates into single buildable files.

Usage

Installation

cargo install cargo-unify

Options

      --lib          If set, a lib crate will be unified
      --bin          If set, a bin crate will be unified (default)
      --path <PATH>  Path to the crate root (i.e., where the `src` is). If not set, will default to current dir [default: .]
  -h, --help         Print help

Examples

Example to unify a lib crate, format it using rustfmt and write it to a file:

cargo unify --lib | rustfmt > bundle.rs

Status

I haven't got the time yet for proper testing (only some basic ones on a Linux machine).

Contributions

PRs, issues, ideas and suggestions and all appreciated and very welcome :)

License

This project is licenced under MIT.

Dependencies

~1.2–1.8MB
~34K SLoC