Cargo plugin for generating a listing of all of the crates used by a root crate, and the terms under which they are licensed.
cargo install cargo-about
```bash
about.toml
and about.hbs
in your cargo projectcargo about init
cargo about generate about.hbs > license.html ```
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.
toml
accepted = [
"Apache-2.0",
"MIT",
]
[[DEPENDENCY.additional]]
root
Name of the root folderlicense
Name of the license. Has to be parsable from SPDX, see https://spdx.org/licenses/license-file
The path to the license file where the license is specifiedlicense-start
The starting line number of the license in the specified license filelicense-end
The ending line number of the license in the specified license file```toml
[[physx-sys.additional]] root = "PhysX" license = "BSD-3-Clause" license-file = "PhysX/README.md" license-start = 3 license-end = 28 ```
[[DEPENDENCY.ignore]]
Sometimes libraries include licenses for example code that you don't want to use.
license
Name of the license that you want to ingore. Has to be parsable from SPDX, see https://spdx.org/licenses/license-file
The path to the license file where the license is specified```toml
[[imgui-sys.ignore]] license = "Zlib" license-file = "third-party/cimgui/imgui/examples/libs/glfw/COPYING.txt" ```
about.hbs
See handlebars
overview
A list of LicenseSet
licenses
A list of License
LicenseSet
count
The number of times the license is usedname
The name of the licenseid
The id
of the licenseLicense
name
The full name of the licenseid
The SPDX identifiertext
The license textsource_path
The path of the licenseused_by
A list of UsedBy
UsedBy
crate
Metadata for a cargo packagepath
Optional path of the dependency that is being used by the license```hbs
```
about.hbs
You can view the full license here
bash
[ERROR] Crate 'aho-corasick': Unable to satisfy [Unlicense OR MIT], with the following accepted licenses [Apache-2.0]
In this case you are missing either MIT
or Unlicense
as an accepted
license in your about.toml
We welcome community contributions to this project.
Please read our Contributor Guide for more information on how to get started.
Licensed under either of
at your option.
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.