diff --git a/libs/codegen/src/licenses.rs b/libs/codegen/src/licenses.rs index 88ddfea..942015c 100644 --- a/libs/codegen/src/licenses.rs +++ b/libs/codegen/src/licenses.rs @@ -18,6 +18,16 @@ pub enum LicenseId { Ofl11, } +impl LicenseId { + fn include_notice(&self) -> bool { + use self::LicenseId::*; + match self { + &Mpl2 => false, + _ => true, + } + } +} + impl quote::ToTokens for LicenseId { fn to_tokens(&self, tokens: &mut quote::Tokens) { use self::LicenseId::*; @@ -54,6 +64,11 @@ impl quote::ToTokens for LicenseReport { &None => quote! { None }, }; + let copyright = match license.include_notice() { + true => copyright, + false => "", + }; + tokens.append(quote! { LicenseInfo { name: #name,