Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Endle/rust-bundler-cp
rust-bundler-cp bundles a cargo package into a single rust file. It's designed for Competitive programming like Codeforces.
https://github.com/Endle/rust-bundler-cp
codeforces competitive-programming rust
Last synced: 12 days ago
JSON representation
rust-bundler-cp bundles a cargo package into a single rust file. It's designed for Competitive programming like Codeforces.
- Host: GitHub
- URL: https://github.com/Endle/rust-bundler-cp
- Owner: Endle
- License: mit
- Created: 2021-08-10T06:25:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T17:29:56.000Z (7 months ago)
- Last Synced: 2024-10-27T11:25:15.759Z (15 days ago)
- Topics: codeforces, competitive-programming, rust
- Language: Rust
- Homepage: https://crates.io/crates/rust_bundler_cp
- Size: 129 KB
- Stars: 17
- Watchers: 2
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua) rust-bundler-cp
This project is based on [rust-bundler](https://github.com/slava-sh/rust-bundler/)
Creates a single-source-file version of a Cargo package. It's designed for Competitive Programming like Codeforces.
## Features
* Uses [Syn](https://docs.rs/syn/latest/syn/) to parse and manipulate a complete syntax tree, instead of doing replacement with regular expression.
* Replaces `extern crate my_lib;` in `main.rs` with the contents of `lib.rs`.
* Expands `mod my_mod;` declarations into `mod my_mod { ... }` blocks.
* [rustfmt](https://github.com/rust-lang/rustfmt) needs to be available in `PATH`, i.e. `dnf install rustfmt`. I'll consider bundle `rustfmt` in my code later.
* Unsupported: External `[dependencies]` in `Cargo.toml`## Example
[Endle's codeforces template](https://github.com/Endle/rust_codeforce_template) is co-evoloved with [rust-bundler-cp](https://github.com/Endle/rust-bundler-cp), and is considered as the example of it.## Usage
Install:
```sh
$ cargo install rust_bundler_cp
```Run:
```sh
$ rust_bundler_cp --input path/to/project >output.rs
$ rust_bundler_cp --input path/to/project --binary a
```## Similar Projects
* This project is based on [slava-sh /rust-bundler](https://github.com/slava-sh/rust-bundler)
* [lpenz/rust-sourcebundler](https://github.com/lpenz/rust-sourcebundler)
is based on regular expressions, whereas this project manipulates the syntax tree
* [MarcosCosmos/cg-rust-bundler](https://github.com/MarcosCosmos/cg-rust-bundler)
* [golang.org/x/tools/cmd/bundle](https://godoc.org/golang.org/x/tools/cmd/bundle) for Go