-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for accessing Cargo.toml
values
#5
Comments
Cargo.toml
values
We currently do not use cargo's own API to parse |
Wouldn't it be sufficient to use
You mean to alter the build script and add an additional step which reads This is quite a simple thing to do (basically the config structure has to be defined and then |
Yes, the most basic solution would be to just suck in |
I made a very basic prototype implementation of this a while ago and opened an RFC for Cargo: rust-lang/rfcs#2801 |
#49 may be of some use, allowing access to only direct dependencies, which is closer to the dependency list that appears in With cargo workspaces, it would now be necessary to store either:
IMO option 2 is the one to shoot for. |
Currently some of the values like crate version or crate name are already present in the generated file, however not all of values are present.
What I would like to suggest is to create some sort of the config, which contains every field from
Cargo.toml
, i.e. to usetoml
andserde-derive
to parse theCargo.toml
and store in an appropriate structure.When the user needs some values from
Cargo.toml
, such approach would allow the users to inspect the content ofCargo.toml
which was used for the crate when it was built.I encountered this issue today: there are several values defined inside
Cargo.toml
in[package.metadata.bundle]
section, and I would like to be able to access the values from the code.The text was updated successfully, but these errors were encountered: