1414
1515enum License : String , Codable , Equatable , CaseIterable {
1616
17- // This is not an exhaustive list, but includes most commonly used license types
17+ // License identifiers match GitHub's API keys from choosealicense.com
18+ case bsd_0_clause = " 0bsd "
1819 case afl_3_0 = " afl-3.0 "
20+ case agpl_3_0 = " agpl-3.0 "
1921 case apache_2_0 = " apache-2.0 "
2022 case artistic_2_0 = " artistic-2.0 "
23+ case blueoak_1_0_0 = " blueoak-1.0.0 "
2124 case bsd_2_clause = " bsd-2-clause "
25+ case bsd_2_clause_patent = " bsd-2-clause-patent "
2226 case bsd_3_clause = " bsd-3-clause "
2327 case bsd_3_clause_clear = " bsd-3-clause-clear "
28+ case bsd_4_clause = " bsd-4-clause "
2429 case bsl_1_0 = " bsl-1.0 "
2530 case cc
26- case cc0_1_0 = " cc0-1.0 "
2731 case cc_by_4_0 = " cc-by-4.0 "
2832 case cc_by_sa_4_0 = " cc-by-sa-4.0 "
29- case wtfpl
33+ case cc0_1_0 = " cc0-1.0 "
34+ case cecill_2_1 = " cecill-2.1 "
35+ case cern_ohl_p_2_0 = " cern-ohl-p-2.0 "
36+ case cern_ohl_s_2_0 = " cern-ohl-s-2.0 "
37+ case cern_ohl_w_2_0 = " cern-ohl-w-2.0 "
3038 case ecl_2_0 = " ecl-2.0 "
3139 case epl_1_0 = " epl-1.0 "
40+ case epl_2_0 = " epl-2.0 "
3241 case eupl_1_1 = " eupl-1.1 "
33- case agpl_3_0 = " agpl-3.0 "
42+ case eupl_1_2 = " eupl-1.2 "
43+ case gfdl_1_3 = " gfdl-1.3 "
3444 case gpl
3545 case gpl_2_0 = " gpl-2.0 "
3646 case gpl_3_0 = " gpl-3.0 "
47+ case isc
3748 case lgpl
3849 case lgpl_2_1 = " lgpl-2.1 "
3950 case lgpl_3_0 = " lgpl-3.0 "
40- case isc
41- case ms_pl = " ms-pl "
51+ case lppl_1_3c = " lppl-1.3c "
4252 case mit
53+ case mit_0 = " mit-0 "
4354 case mpl_2_0 = " mpl-2.0 "
55+ case ms_pl = " ms-pl "
56+ case ms_rl = " ms-rl "
57+ case mulanpsl_2_0 = " mulanpsl-2.0 "
58+ case ncsa
59+ case odbl_1_0 = " odbl-1.0 "
60+ case ofl_1_1 = " ofl-1.1 "
4461 case osl_3_0 = " osl-3.0 "
4562 case postgresql
46- case ncsa
63+ case upl_1_0 = " upl-1.0 "
4764 case unlicense // NB: This is an actual license and *not* a typo of "unlicensed"
65+ case vim
66+ case wtfpl
4867 case zlib
4968
5069 // These are special cases, not license types
@@ -53,36 +72,55 @@ enum License: String, Codable, Equatable, CaseIterable {
5372
5473 var fullName : String {
5574 switch self {
75+ case . bsd_0_clause: return " BSD Zero Clause License "
5676 case . afl_3_0: return " Academic Free License v3.0 "
77+ case . agpl_3_0: return " GNU Affero General Public License v3.0 "
5778 case . apache_2_0: return " Apache License 2.0 "
5879 case . artistic_2_0: return " Artistic License 2.0 "
59- case . bsd_2_clause: return " BSD 2-clause \" Simplified \" license "
60- case . bsd_3_clause: return " BSD 3-clause \" New \" or \" Revised \" license "
61- case . bsd_3_clause_clear: return " BSD 3-clause Clear license "
80+ case . blueoak_1_0_0: return " Blue Oak Model License 1.0.0 "
81+ case . bsd_2_clause: return " BSD 2-Clause \" Simplified \" License "
82+ case . bsd_2_clause_patent: return " BSD 2-Clause Plus Patent License "
83+ case . bsd_3_clause: return " BSD 3-Clause \" New \" or \" Revised \" License "
84+ case . bsd_3_clause_clear: return " BSD 3-Clause Clear License "
85+ case . bsd_4_clause: return " BSD 4-Clause \" Original \" License "
6286 case . bsl_1_0: return " Boost Software License 1.0 "
6387 case . cc: return " Creative Commons License "
64- case . cc0_1_0: return " Creative Commons Zero v1.0 Universal "
6588 case . cc_by_4_0: return " Creative Commons Attribution 4.0 "
6689 case . cc_by_sa_4_0: return " Creative Commons Attribution Share Alike 4.0 "
67- case . wtfpl: return " Do What The F**k You Want To Public License "
90+ case . cc0_1_0: return " Creative Commons Zero v1.0 Universal "
91+ case . cecill_2_1: return " CeCILL Free Software License Agreement v2.1 "
92+ case . cern_ohl_p_2_0: return " CERN Open Hardware Licence Version 2 - Permissive "
93+ case . cern_ohl_s_2_0: return " CERN Open Hardware Licence Version 2 - Strongly Reciprocal "
94+ case . cern_ohl_w_2_0: return " CERN Open Hardware Licence Version 2 - Weakly Reciprocal "
6895 case . ecl_2_0: return " Educational Community License v2.0 "
6996 case . epl_1_0: return " Eclipse Public License 1.0 "
97+ case . epl_2_0: return " Eclipse Public License 2.0 "
7098 case . eupl_1_1: return " European Union Public License 1.1 "
71- case . agpl_3_0: return " GNU Affero General Public License v3.0 "
99+ case . eupl_1_2: return " European Union Public License 1.2 "
100+ case . gfdl_1_3: return " GNU Free Documentation License v1.3 "
72101 case . gpl: return " GNU General Public License family "
73102 case . gpl_2_0: return " GNU General Public License v2.0 "
74103 case . gpl_3_0: return " GNU General Public License v3.0 "
104+ case . isc: return " ISC License "
75105 case . lgpl: return " GNU Lesser General Public License family "
76106 case . lgpl_2_1: return " GNU Lesser General Public License v2.1 "
77107 case . lgpl_3_0: return " GNU Lesser General Public License v3.0 "
78- case . isc: return " ISC License "
79- case . ms_pl: return " Microsoft Public License "
108+ case . lppl_1_3c: return " LaTeX Project Public License v1.3c "
80109 case . mit: return " MIT License "
110+ case . mit_0: return " MIT No Attribution License "
81111 case . mpl_2_0: return " Mozilla Public License 2.0 "
112+ case . ms_pl: return " Microsoft Public License "
113+ case . ms_rl: return " Microsoft Reciprocal License "
114+ case . mulanpsl_2_0: return " Mulan Permissive Software License, Version 2 "
115+ case . ncsa: return " University of Illinois/NCSA Open Source License "
116+ case . odbl_1_0: return " Open Data Commons Open Database License v1.0 "
117+ case . ofl_1_1: return " SIL Open Font License 1.1 "
82118 case . osl_3_0: return " Open Software License 3.0 "
83119 case . postgresql: return " PostgreSQL License "
84- case . ncsa : return " University of Illinois/NCSA Open Source License"
120+ case . upl_1_0 : return " Universal Permissive License v1.0 "
85121 case . unlicense: return " The Unlicense "
122+ case . vim: return " Vim License "
123+ case . wtfpl: return " Do What The F**k You Want To Public License "
86124 case . zlib: return " zLib License "
87125
88126 case . other: return " Unknown or Unrecognised License "
@@ -92,36 +130,55 @@ enum License: String, Codable, Equatable, CaseIterable {
92130
93131 var shortName : String {
94132 switch self {
133+ case . bsd_0_clause: return " 0BSD "
95134 case . afl_3_0: return " AFL 3.0 "
135+ case . agpl_3_0: return " AGPL 3.0 "
96136 case . apache_2_0: return " Apache 2.0 "
97137 case . artistic_2_0: return " Artistic 2.0 "
138+ case . blueoak_1_0_0: return " BlueOak 1.0.0 "
98139 case . bsd_2_clause: return " BSD 2-Clause "
140+ case . bsd_2_clause_patent: return " BSD 2-Clause Patent "
99141 case . bsd_3_clause: return " BSD 3-Clause "
100142 case . bsd_3_clause_clear: return " BSD 3-Clause Clear "
143+ case . bsd_4_clause: return " BSD 4-Clause "
101144 case . bsl_1_0: return " Boost 1.0 "
102145 case . cc: return " CC "
103- case . cc0_1_0: return " CC Zero 1.0 "
104146 case . cc_by_4_0: return " CC Attribution 4.0 "
105147 case . cc_by_sa_4_0: return " CC Attribution SA 4.0 "
106- case . wtfpl: return " DWTFYWTPL "
148+ case . cc0_1_0: return " CC Zero 1.0 "
149+ case . cecill_2_1: return " CeCILL 2.1 "
150+ case . cern_ohl_p_2_0: return " CERN OHL-P 2.0 "
151+ case . cern_ohl_s_2_0: return " CERN OHL-S 2.0 "
152+ case . cern_ohl_w_2_0: return " CERN OHL-W 2.0 "
107153 case . ecl_2_0: return " ECL 2.0 "
108154 case . epl_1_0: return " EPL 1.0 "
155+ case . epl_2_0: return " EPL 2.0 "
109156 case . eupl_1_1: return " EUPL 1.1 "
110- case . agpl_3_0: return " AGPL 3.0 "
157+ case . eupl_1_2: return " EUPL 1.2 "
158+ case . gfdl_1_3: return " GFDL 1.3 "
111159 case . gpl: return " GPL "
112160 case . gpl_2_0: return " GPL 2.0 "
113161 case . gpl_3_0: return " GPL 3.0 "
162+ case . isc: return " ISC "
114163 case . lgpl: return " LGPL "
115164 case . lgpl_2_1: return " LGPL 2.1 "
116165 case . lgpl_3_0: return " LGPL 3.0 "
117- case . isc: return " ISC "
118- case . ms_pl: return " MSPL "
166+ case . lppl_1_3c: return " LPPL 1.3c "
119167 case . mit: return " MIT "
168+ case . mit_0: return " MIT-0 "
120169 case . mpl_2_0: return " MPL 2.0 "
170+ case . ms_pl: return " MSPL "
171+ case . ms_rl: return " MSRL "
172+ case . mulanpsl_2_0: return " MulanPSL 2.0 "
173+ case . ncsa: return " NCSA "
174+ case . odbl_1_0: return " ODbL 1.0 "
175+ case . ofl_1_1: return " OFL 1.1 "
121176 case . osl_3_0: return " OSL 3.0 "
122177 case . postgresql: return " PostgreSQL "
123- case . ncsa : return " NCSA "
178+ case . upl_1_0 : return " UPL 1.0 "
124179 case . unlicense: return " The Unlicense "
180+ case . vim: return " Vim "
181+ case . wtfpl: return " DWTFYWTPL "
125182 case . zlib: return " zLib "
126183
127184 case . other: return " Unknown license "
@@ -136,12 +193,21 @@ enum License: String, Codable, Equatable, CaseIterable {
136193 case . none:
137194 return . none
138195 case . agpl_3_0,
196+ . cecill_2_1,
197+ . cern_ohl_s_2_0,
198+ . cern_ohl_w_2_0,
199+ . eupl_1_1,
200+ . eupl_1_2,
201+ . gfdl_1_3,
139202 . gpl,
140203 . gpl_2_0,
141204 . gpl_3_0,
142205 . lgpl,
143206 . lgpl_2_1,
144- . lgpl_3_0: return . incompatibleWithAppStore
207+ . lgpl_3_0,
208+ . lppl_1_3c,
209+ . ms_rl,
210+ . osl_3_0: return . incompatibleWithAppStore
145211 default : return . compatibleWithAppStore
146212 }
147213 }
0 commit comments