📜 cargo-about
Cargo plugin for generating a listing of all of the crates used by a root crate, and the terms under which they are licensed.
Getting started:
Installing
cargo install cargo-about
Generate license information for your own project
# Generates `about.toml` and `about.hbs` in your cargo project
# Generate the license information with
about.toml
[accepted]
Priority list of all the accepted licenses for a project. cargo-about will try to satisfy the licenses in the order that they are declared in this list.
= [
"Apache-2.0",
"MIT",
]
[[DEPENDENCY.additional]]
rootName of the root folderlicenseName of the license. Has to be parsable from SPDX, see https://spdx.org/licenses/license-fileThe path to the license file where the license is specifiedlicense-startThe starting line number of the license in the specified license filelicense-endThe ending line number of the license in the specified license file
# Example
[[]]
= "PhysX"
= "BSD-3-Clause"
= "PhysX/README.md"
= 3
= 28
[[DEPENDENCY.ignore]]
Sometimes libraries include licenses for example code that you don't want to use.
licenseName of the license that you want to ingore. Has to be parsable from SPDX, see https://spdx.org/licenses/license-fileThe path to the license file where the license is specified
# Example
[[]]
= "Zlib"
= "third-party/cimgui/imgui/examples/libs/glfw/COPYING.txt"
about.hbs
See handlebars
Variables
overviewA list ofLicenseSetlicensesA list ofLicense
Types
LicenseSet
countThe number of times the license is usednameThe name of the licenseidTheidof the license
License
nameThe full name of the licenseidThe SPDX identifiertextThe license textsource_pathThe path of the licenseused_byA list ofUsedBy
UsedBy
crateMetadata for a cargo packagepathOptional path of the dependency that is being used by the license
Example
<ul class="licenses-overview">
{{#each overview}}
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li>
{{/each}}
</ul>
Preview of the default about.hbs
You can view the full license here
FAQ
Unable to satisfy the following licenses
In this case you are missing either MIT or Unlicense as an accepted license in your about.toml
Contributing
We welcome community contributions to this project.
Please read our Contributor Guide for more information on how to get started.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.