1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
//
// SPDX-License-Identifier: LGPL-2.1-or-later

//! Proc-macro for embedding licensing information about a crate.
//!
//! It also exposes its internal functions that allow
//! either collecting licensing information at runtime (with [`collect()`]),
//! when in the directory of the manifest,
//! or collecting licensing information from a specific manifest file (with
//! [`collect_from_manifest`]).
//!
//! However, the recommended way to use this crate is the macro [`collect!`]:
//!
//! ```rust
//! let licensing = embed_licensing::collect!();
//!
//! for package in licensing.packages {
//!     if let embed_licensing::CrateLicense::SpdxExpression(expr) = package.license {
//!         println!("{} {} ({})", package.name, package.version, expr);
//!     } else {
//!         println!("{} {} uses custom license", package.name, package.version);
//!     }
//! }
//! ```

pub use embed_licensing_core::{
    collect, collect_from_manifest, Crate, CrateLicense, Error, Licensing,
};
pub use embed_licensing_macros::collect;