Giter VIP home page Giter VIP logo

cargo-manifest's Introduction

cargo-manifest

serde definitions to read and write Cargo.toml files.

Description

This Rust crate contains various structs and enums to represent the contents of a Cargo.toml file. These definitions can be used with serde and the toml crate to read and write Cargo.toml manifest files.

This crate also to some degree supports post-processing of the data to emulate Cargo's workspace inheritance and autobins features. This is used for example by crates.io to extract whether a crate contains a library or executable binaries.

Note

The cargo team regularly adds new features to the Cargo.toml file definition. This crate aims to keep up-to-date with these changes. You should keep this crate up-to-date to correctly parse all fields in modern Cargo.toml files.

Installation

cargo add cargo-manifest

Usage

use cargo_manifest::Manifest;

let manifest = Manifest::from_path("Cargo.toml").unwrap();

see docs.rs for more information.

Users

Alternatives

This crate is a fork of the cargo_toml project. There are only some minor differences between these projects at this point, you will need to evaluate which one fits your needs better.

There is also cargo-util-schemas now, which is maintained by the cargo team themselves. This crate was extracted from the cargo codebase and is used inside the cargo binary itself. It is kept up-to-date with the latest changes to the Cargo.toml file format, but is currently lacking some of the post-processing features that cargo-manifest provides.

License

This project is licensed under either of

at your option.

cargo-manifest's People

Contributors

adwhit avatar andrewbaxter avatar connec avatar dessalines avatar divergentdave avatar fornwall avatar kornelski avatar lukemathwalker avatar markdingram avatar mkroening avatar mladedav avatar nathanhowell avatar slinkydeveloper avatar strohel avatar turbo87 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cargo-manifest's Issues

Version 0.13 is not tagged

The version was released 1.9.2024 but the latest tag in GitHub is 0.12.1. It seems that cargo release did not create the tag for some reason, just the release commit on master.

`[[bin]]` are not merged with auto-discovered targets

https://doc.rust-lang.org/cargo/reference/cargo-targets.html#target-auto-discovery states that

For packages with the 2015 edition, the default for auto-discovery is false if at least one target is manually defined in Cargo.toml. Beginning with the 2018 edition, the default is always true.

It looks like cargo-manifest is currently only implementing the 2015 edition rules (see https://github.com/LukeMathWalker/cargo-manifest/blob/v0.14.0/src/lib.rs#L282)

Switch to cargo-util-schemas structs

https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#internal-1

New member crate cargo-util-schemas! This contains low-level Cargo schema types, focusing on serde and FromStr for use in reading files and parsing command-lines. Any logic for getting final semantics from these will likely need other tools to process, like cargo metadata. The crates.io publish of this crate is the same as other members crates. It follows Rust's 6-week release process. rust-lang/cargo#13178 rust-lang/cargo#13185 rust-lang/cargo#13186 rust-lang/cargo#13209 rust-lang/cargo#13267

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.