cargo-equip
A Cargo subcommand to bundle your code into one .rs file for competitive programming.
Example
[]
= "solve"
= "0.0.0"
= "2018"
[]
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "https://github.com/qryxip/ac-library-rs-parted" }
= { = "/path/to/input" }
= { = "/path/to/output" }
= { = "/path/to/tonelli_shanks" }
# ...
// Uncomment this line if you don't use your libraries. (`--check` still works)
//#![cfg_attr(cargo_equip, cargo_equip::skip)]
extern crate input as _;
use ModInt;
use Write as _;
use ModIntBaseExt as _;
use permutohedron as _;
↓
❯ cargo equip --resolve-cfgs --remove docs --minify libs --rustfmt --check -o ./bundled.rs
Running `/home/ryo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo check --message-format json -p -p 'ac-library-rs-parted-build:0.1.0' -p 'ac-library-rs-parted-convolution:0.1.0' -p 'ac-library-rs-parted-dsu:0.1.0' -p 'ac-library-rs-parted-fenwicktree:0.1.0' -p 'ac-library-rs-parted-internal-bit:0.1.0' -p 'ac-library-rs-parted-internal-math:0.1.0' -p 'ac-library-rs-parted-internal-queue:0.1.0' -p 'ac-library-rs-parted-internal-scc:0.1.0' -p 'ac-library-rs-parted-internal-type-traits:0.1.0' -p 'ac-library-rs-parted-lazysegtree:0.1.0' -p 'ac-library-rs-parted-math:0.1.0' -p 'ac-library-rs-parted-maxflow:0.1.0' -p 'ac-library-rs-parted-mincostflow:0.1.0' -p 'ac-library-rs-parted-modint:0.1.0' -p 'ac-library-rs-parted-scc:0.1.0' -p 'ac-library-rs-parted-segtree:0.1.0' -p 'ac-library-rs-parted-string:0.1.0' -p 'ac-library-rs-parted-twosat:0.1.0' -p 'anyhow:1.0.34' -p 'byteorder:1.3.4' -p 'num-traits:0.2.14' -p 'proc-macro2:1.0.10' -p 'ryu:1.0.5' -p 'serde:1.0.113' -p 'serde_derive:1.0.113' -p 'serde_json:1.0.59' -p 'syn:1.0.17' -p 'typenum:1.12.0'`
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `/home/ryo/.cargo/bin/rustup run nightly cargo udeps --output json -p solve --bin solve`
Checking solve v0.0.0 (/home/ryo/src/local/a/solve)
Finished dev [unoptimized + debuginfo] target(s) in 0.16s
info: Loading save analysis from "/home/ryo/src/local/a/solve/target/debug/deps/save-analysis/solve-2970d6e10b9c0877.json"
Bundling the code
Checking cargo-equip-check-output-nq4nm7zkj9vtgbd9 v0.1.0 (/tmp/cargo-equip-check-output-nq4nm7zkj9vtgbd9)
Finished dev [unoptimized + debuginfo] target(s) in 0.35s
Submit Info #29083 - Library-Checker
Installation
Install a nightly toolchain and cargo-udeps first.
❯ rustup update nightly
❯ cargo install --git https://github.com/est31/cargo-udeps # for est31/cargo-udeps#80
Crates.io
❯ cargo install cargo-equip
master
❯ cargo install --git https://github.com/qryxip/cargo-equip
GitHub Releases
Usage
TODO (Japanese)
License
Dual-licensed under MIT or Apache-2.0.