slava-sh / rust-bundler

Creates a single-source-file version of a Cargo package
https://crates.io/crates/bundler
MIT License
21 stars 8 forks source link

Support for automatic configuration within cargo.toml #1

Open MarcosCosmos opened 6 years ago

MarcosCosmos commented 6 years ago

I'm not sure if it's actually possible, but I think it'd be conveniant to specify the destination file via cargo.toml (with the src being implicitly lib.rs or main.rs already, although it could also be configured). Additionally (if possible), it'd be nice to have some kind of implicit build.rs ship with the bundler crate. (That is, rather than having to manually write or copy one into your project).

It was always one of the key motivations for me of porting my project to rust.

Do you know if it's possible? If you haven't already looked into it, I might fork your project and give it a go over the weekend.

slava-sh commented 6 years ago

It's true that the inputs and outputs could be configurable. I used the bundler executable as part of a bash pipeline and just didn't need more flexibility.

I don't think it's possible to have a completely implicit build.rs script. A reasonable solution might be providing a concise and ready-to-use build.rs in the documentation. I'm happy to accept a PR if you'd like to work on it.