einvoice_validator/
licences.rs1pub use einvoice_xsd::Licence;
4
5const MIT: Licence = Licence {
7 id: "MIT",
8 covers: MIT_COVERS,
9 text: include_str!("../LICENSES/MIT.txt"),
10};
11
12#[cfg(all(feature = "pdf", feature = "fetch", not(target_family = "wasm")))]
16const MIT_COVERS: &str = "the code of einvoice-validator and of the crates of the project it \
17 is built from (einvoice-bigint, einvoice-pdf, einvoice-schematron, einvoice-svrl, einvoice-xdm, \
18 einvoice-xml, einvoice-xpath, einvoice-xpath-eval, einvoice-xsd, einvoice-xslt, \
19 einvoice-xslt-exec)";
20#[cfg(all(
21 feature = "pdf",
22 not(all(feature = "fetch", not(target_family = "wasm")))
23))]
24const MIT_COVERS: &str = "the code of einvoice-validator and of the crates of the project it \
25 is built from (einvoice-bigint, einvoice-pdf, einvoice-svrl, einvoice-xdm, einvoice-xml, \
26 einvoice-xpath, einvoice-xpath-eval, einvoice-xsd, einvoice-xslt, \
27 einvoice-xslt-exec)";
28#[cfg(all(not(feature = "pdf"), feature = "fetch", not(target_family = "wasm")))]
29const MIT_COVERS: &str = "the code of einvoice-validator and of the crates of the project it \
30 is built from (einvoice-bigint, einvoice-schematron, einvoice-svrl, einvoice-xdm, einvoice-xml, \
31 einvoice-xpath, einvoice-xpath-eval, einvoice-xsd, einvoice-xslt, \
32 einvoice-xslt-exec)";
33#[cfg(all(
34 not(feature = "pdf"),
35 not(all(feature = "fetch", not(target_family = "wasm")))
36))]
37const MIT_COVERS: &str = "the code of einvoice-validator and of the crates of the project it \
38 is built from (einvoice-bigint, einvoice-svrl, einvoice-xdm, einvoice-xml, einvoice-xpath, \
39 einvoice-xpath-eval, einvoice-xsd, einvoice-xslt, einvoice-xslt-exec)";
40
41#[cfg(any(feature = "cen-ubl", feature = "cen-cii"))]
43const EUPL: Licence = Licence {
44 id: "EUPL-1.2",
45 covers: EUPL_COVERS,
46 text: include_str!("../LICENSES/EUPL-1.2.txt"),
47};
48
49#[cfg(all(feature = "cen-ubl", feature = "cen-cii"))]
51const EUPL_COVERS: &str = "the CEN EN 16931 UBL and CII validation stylesheets, release 1.3.17 \
52 (ubl/xslt/EN16931-UBL-validation.xslt and cii/xslt/EN16931-CII-validation.xslt, \
53 unmodified), published by CEN/TC 434 and embedded by einvoice-validator as the built-in \
54 rule sets cen-ubl and cen-cii";
55#[cfg(all(feature = "cen-ubl", not(feature = "cen-cii")))]
56const EUPL_COVERS: &str = "the CEN EN 16931 UBL validation stylesheet, release 1.3.17 \
57 (ubl/xslt/EN16931-UBL-validation.xslt, unmodified), published by CEN/TC 434 and \
58 embedded by einvoice-validator as the built-in rule set cen-ubl";
59#[cfg(all(feature = "cen-cii", not(feature = "cen-ubl")))]
60const EUPL_COVERS: &str = "the CEN EN 16931 CII validation stylesheet, release 1.3.17 \
61 (cii/xslt/EN16931-CII-validation.xslt, unmodified), published by CEN/TC 434 and \
62 embedded by einvoice-validator as the built-in rule set cen-cii";
63
64#[must_use]
75pub fn licences() -> Vec<Licence> {
76 let mut out = vec![MIT];
77 #[cfg(any(feature = "cen-ubl", feature = "cen-cii"))]
78 out.push(EUPL);
79 out.extend(
81 einvoice_xsd::LICENCES
82 .iter()
83 .filter(|l| l.id != "MIT")
84 .copied(),
85 );
86 out
87}