6 stable releases
1.1.0 | Sep 19, 2024 |
---|---|
1.0.4 | Aug 14, 2024 |
1.0.2 | Aug 1, 2024 |
1.0.1 | Jul 31, 2024 |
#173 in Build Utils
18KB
290 lines
license-retriever
Retrieves licenses of all Rust dependencies. Originally written for stencil2 but is now separated into its own project.
How
Licenses are retrieved by searching in the following order:
- Folder that
Cargo.toml
is in - Crate cache in
~/.cargo
- GitHub repository
- Text from
spdx
with identifier inCargo.toml
Usage
Cargo
cargo add license-retriever
cargo add --build license-retriever
build.rs
use license_retriever::{Config, LicenseRetriever};
fn main() {
let config = Config {
// options...
..Config::default()
};
LicenseRetriever::from_config(&config).unwrap().save_in_out_dir("LICENSE-3RD-PARTY").unwrap();
}
main.rs
use license_retriever;
fn main() {
let licenses = license_retriever::license_retriever_data!("LICENSE-3RD-PARTY").unwrap();
println!("{}", licenses);
}
Dependencies
~14MB
~307K SLoC