1 |
commit: 1c7018663e04e676f4ff74a9604913a81ddbfbf4 |
2 |
Author: zongyu <zzy2529420793 <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Aug 1 09:04:07 2020 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 1 15:17:55 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/java-ebuilder.git/commit/?id=1c701866 |
7 |
|
8 |
Use Set instead of List for storing Licenses, update license map |
9 |
|
10 |
Signed-off-by: zongyu <zzy2529420793 <AT> gmail.com> |
11 |
|
12 |
.../gentoo/java/ebuilder/maven/MavenLicenses.java | 3 +- |
13 |
.../gentoo/java/ebuilder/maven/MavenProject.java | 12 +- |
14 |
src/main/resources/licenseMap.properties | 152 ++++++++++++++++++++- |
15 |
3 files changed, 161 insertions(+), 6 deletions(-) |
16 |
|
17 |
diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java |
18 |
index e2db62c..f2f4f9a 100644 |
19 |
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java |
20 |
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenLicenses.java |
21 |
@@ -51,7 +51,8 @@ public class MavenLicenses { |
22 |
* @return license identifier that works with Portage |
23 |
*/ |
24 |
public String getEquivalentLicense(String licenseName) { |
25 |
- final String portageLicense = licenseMap.get(licenseName); |
26 |
+ final String portageLicense = |
27 |
+ licenseMap.get(licenseName.toLowerCase()); |
28 |
|
29 |
if (portageLicense == null) { |
30 |
return "!!!equivalentPortageLicenseName-not-found!!!"; |
31 |
|
32 |
diff --git a/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java b/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java |
33 |
index fa4958d..2fd88de 100644 |
34 |
--- a/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java |
35 |
+++ b/src/main/java/org/gentoo/java/ebuilder/maven/MavenProject.java |
36 |
@@ -4,7 +4,9 @@ import java.io.PrintWriter; |
37 |
import java.nio.file.Path; |
38 |
import java.util.ArrayList; |
39 |
import java.util.Collections; |
40 |
+import java.util.HashSet; |
41 |
import java.util.List; |
42 |
+import java.util.Set; |
43 |
|
44 |
/** |
45 |
* Contains information about maven project collected from pom.xml. |
46 |
@@ -44,7 +46,7 @@ public class MavenProject { |
47 |
/** |
48 |
* Lisences. |
49 |
*/ |
50 |
- private List<String> licenses = new ArrayList<>(10); |
51 |
+ private Set<String> licenses = new HashSet<>(10); |
52 |
/** |
53 |
* Homepage URL. |
54 |
*/ |
55 |
@@ -113,8 +115,12 @@ public class MavenProject { |
56 |
* |
57 |
* @param license {@link #licenses} |
58 |
*/ |
59 |
- public void addLicense(final String license) { |
60 |
- licenses.add(license); |
61 |
+ public void addLicense(final String portageLicenses) { |
62 |
+ final String[] parts = portageLicenses.split(":"); |
63 |
+ |
64 |
+ for (String eachLicense: parts) { |
65 |
+ licenses.add(eachLicense); |
66 |
+ } |
67 |
} |
68 |
|
69 |
/** |
70 |
|
71 |
diff --git a/src/main/resources/licenseMap.properties b/src/main/resources/licenseMap.properties |
72 |
index fe9262a..5cd2e5d 100644 |
73 |
--- a/src/main/resources/licenseMap.properties |
74 |
+++ b/src/main/resources/licenseMap.properties |
75 |
@@ -1,2 +1,150 @@ |
76 |
-#Fri Jul 31 23:28:29 CST 2020 |
77 |
-Apache\ License,\ Version\ 2.0=Apache-2.0 |
78 |
+#Sat Aug 01 15:44:04 CST 2020 |
79 |
+# A properties file that maps license name of pom.xml to |
80 |
+# portage compatible names. |
81 |
+# |
82 |
+# If the name indicates multiple licenses, please record |
83 |
+# the license like: |
84 |
+#@CODE |
85 |
+# name\ from\ pom.xml=GPL-2:MIT:BSD |
86 |
+#@CODE |
87 |
+# |
88 |
+# If it indicates multiple choices of licenses, please |
89 |
+# record the license like: |
90 |
+#@CODE |
91 |
+# name\ from\ pom.xml=||\ (\ GPL-2\ MIT\ ) |
92 |
+#@CODE |
93 |
+# |
94 |
+# according to dev-java/bcpkix::gentoo |
95 |
+bouncy\ castle\ licence=BSD |
96 |
+# according to dev-lang/scala::gentoo |
97 |
+bsd-like=BSD |
98 |
+# |
99 |
+3-clause\ bsd\ license=BSD |
100 |
+apache\ 2=Apache-2.0 |
101 |
+apache\ 2.0=Apache-2.0 |
102 |
+apache-2.0=Apache-2.0 |
103 |
+apache\ 2.0\ license=Apache-2.0 |
104 |
+apache\ license=Apache |
105 |
+apache\ license\ 2=Apache-2.0 |
106 |
+apache\ license\ 2.0=Apache-2.0 |
107 |
+apache\ license,\ 2.0=Apache-2.0 |
108 |
+apache\ license\ v2.0=Apache-2.0 |
109 |
+apache\ license\ version\ 2=Apache-2.0 |
110 |
+apache\ license,\ version\ 2.0=Apache-2.0 |
111 |
+apache\ license\ version\ 2.0=Apache-2.0 |
112 |
+apache\ license,\ version\ 2.0=Apache-2.0 |
113 |
+apache\ public\ license\ 2.0=Apache-2.0 |
114 |
+apache\ software\ license,\ version\ 1.1=Apache-1.1 |
115 |
+apache\ software\ license\ -\ version\ 2.0=Apache-2.0 |
116 |
+apache\ v2=Apache-2.0 |
117 |
+asf\ 2.0=Apache-2.0 |
118 |
+asl=Apache-2.0 |
119 |
+asl\ 2.0=Apache-2.0 |
120 |
+asl,\ version\ 2=Apache-2.0 |
121 |
+bsd=BSD-1 |
122 |
+bsd\ 2-clause=BSD-2 |
123 |
+bsd-2-clause=BSD-2 |
124 |
+bsd\ 2-clause\ license=BSD-2 |
125 |
+bsd\ 3-clause=BSD |
126 |
+bsd-3-clause=BSD |
127 |
+bsd\ licence=BSD-1 |
128 |
+bsd\ license=BSD-1 |
129 |
+bsd\ style=BSD |
130 |
+cc0=CC0-1.0 |
131 |
+cddl\ 1.0=CDDL |
132 |
+cddl\ 1.1=CDDL-1.1 |
133 |
+cddl+gpl\ license=CDDL:GPL-1 |
134 |
+cddl/gplv2+ce=||\ (\ CDDL\ GPL-2-with-classpath-exception\ ) |
135 |
+cddl\ +\ gplv2\ with\ classpath\ exception=CDDL:GPL-2-with-classpath-exception |
136 |
+cddl\ license=CDDL |
137 |
+cddl\ v1.1\ /\ gpl\ v2\ dual\ license=CDDL-1.1:GPL-2 |
138 |
+common\ development\ and\ distribution\ license=CDDL |
139 |
+common\ development\ and\ distribution\ license\ (cddl)\ plus\ gpl=CDDL:GPL |
140 |
+common\ development\ and\ distribution\ license\ (cddl)\ v1.0=CDDL |
141 |
+common\ development\ and\ distribution\ license\ (cddl)\ version\ 1.0=CDDL |
142 |
+common\ public\ license\ -\ v\ 1.0=CPL-1.0 |
143 |
+common\ public\ license\ version\ 1.0=CPL-1.0 |
144 |
+dual\ license\ consisting\ of\ the\ cddl\ v1.1\ and\ gpl\ v2=CDDL-1.1:GPL-2 |
145 |
+eclipse\ distribution\ license\ (edl),\ version\ 1.0=EPL-1.0 |
146 |
+eclipse\ distribution\ license\ -\ v\ 1.0=EPL-1.0 |
147 |
+eclipse\ distribution\ license\ v.\ 1.0=EPL-1.0 |
148 |
+eclipse\ public\ license=EPL-1.0 |
149 |
+eclipse\ public\ license\ 1.0=EPL-1.0 |
150 |
+eclipse\ public\ license\ 2.0=EPL-2.0 |
151 |
+eclipse\ public\ license\ (epl),\ version\ 1.0=EPL-1.0 |
152 |
+eclipse\ public\ license\ -\ v\ 1.0=EPL-1.0 |
153 |
+eclipse\ public\ license\ v1.0=EPL-1.0 |
154 |
+eclipse\ public\ license\ -\ v\ 2.0=EPL-2.0 |
155 |
+eclipse\ public\ license\ v.\ 2.0=EPL-2.0 |
156 |
+eclipse\ public\ license\ v2.0=EPL-2.0 |
157 |
+eclipse\ public\ license\ -\ version\ 1.0=EPL-1.0 |
158 |
+eclipse\ public\ license,\ version\ 1.0=EPL-1.0 |
159 |
+eclipse\ public\ license\ -\ version\ 2.0=EPL-2.0 |
160 |
+eclipse\ public\ license,\ version\ 2.0=EPL-2.0 |
161 |
+edl\ 1.0=EPL-1.0 |
162 |
+epl=EPL-1.0 |
163 |
+epl\ 2.0=EPL-2.0 |
164 |
+epl-2.0=EPL-2.0 |
165 |
+gnu\ general\ public\ library=GPL-1 |
166 |
+gnu\ general\ public\ license,\ version\ 2=GPL-2 |
167 |
+gnu\ general\ public\ license\ version\ 2=GPL-2 |
168 |
+gnu\ general\ public\ license,\ version\ 2\ with\ the\ classpath\ exception=GPL-2-with-classpath-exception |
169 |
+gnu\ general\ public\ license,\ version\ 2,\ with\ the\ classpath\ exception=GPL-2-with-classpath-exception |
170 |
+gnu\ general\ public\ license,\ version\ 2\ with\ the\ gnu\ classpath\ exception=GPL-2-with-classpath-exception |
171 |
+gnu\ lesser\ general\ public\ licence=LGPL-3 |
172 |
+gnu\ lesser\ general\ public\ license=LGPL-3 |
173 |
+gnu\ lesser\ general\ public\ license\ as\ published\ by\ the\ free\ software\ foundation;\ either\ version\ 2.1\ of\ the\ license,\ or\ (at\ your\ option)\ any\ later\ version.=LGPL-2.1 |
174 |
+gnu\ lesser\ general\ public\ license\ (lgpl)=LGPL-3 |
175 |
+gnu\ lesser\ general\ public\ license\ (lgpl),\ version\ 2.1=LGPL-2.1 |
176 |
+gnu\ lesser\ general\ public\ license\ v2.1=LGPL-2.1 |
177 |
+gnu\ lesser\ general\ public\ license\ version\ 2.1=LGPL-2.1 |
178 |
+gnu\ lesser\ general\ public\ license,\ version\ 2.1=LGPL-2.1 |
179 |
+gnu\ lesser\ public\ license=LGPL-3 |
180 |
+gnu\ lgplv3=LGPL-3 |
181 |
+gnu\ library\ general\ public\ license\ v2.1\ or\ later=LGPL-2.1 |
182 |
+go\ license=BSD |
183 |
+gpl-2.0=GPL-2 |
184 |
+gpl-2.0-with-classpath-exception=GPL-2-with-classpath-exception |
185 |
+gpl2\ w/\ cpe=GPL-2-with-classpath-exception |
186 |
+gpl\ 3=GPL-3 |
187 |
+gpl\ v2=GPL-2 |
188 |
+gpl\ v2\ with\ classpath\ exception=GPL-2-with-classpath-exception |
189 |
+hsqldb\ license=BSD |
190 |
+indiana\ university\ extreme!\ lab\ software\ license=Indiana-University-Extreme-Lab |
191 |
+indiana\ university\ extreme!\ lab\ software\ license\ 1.1.1=Indiana-University-Extreme-Lab |
192 |
+indiana\ university\ extreme!\ lab\ software\ license,\ vesion\ 1.1.1=Indiana-University-Extreme-Lab |
193 |
+jquery\ license=MIT:CC0 |
194 |
+lgpl=LGPL-3 |
195 |
+lgpl\ 2.1=LGPL-2.1 |
196 |
+lgpl-2.1=LGPL-2.1 |
197 |
+lgpl\ 3=LGPL-3 |
198 |
+lgplv2.1=LGPL-2.1 |
199 |
+lgpl,\ version\ 2.1=LGPL-2.1 |
200 |
+mit\ license=MIT |
201 |
+modified\ bsd=BSD |
202 |
+mozilla\ public\ license\ 1.1\ (mpl\ 1.1)=MPL-1.1 |
203 |
+mozilla\ public\ license\ version\ 2.0=MPL-2.0 |
204 |
+mpl\ 1.1=MPL-1.1 |
205 |
+mpl\ 2.0\ or\ epl\ 1.0=||\ (\ MPL-1.1\ EPL-1.0\ ) |
206 |
+new\ bsd\ license=BSD |
207 |
+provided\ without\ support\ or\ warranty=JSON |
208 |
+public\ domain=public-domain |
209 |
+public\ domain,\ per\ creative\ commons\ cc0=public-domain |
210 |
+public\ domain,\ sun\ microsoystems=public-domain |
211 |
+revised\ bsd=BSD |
212 |
+similar\ to\ apache\ license\ but\ with\ the\ acknowledgment\ clause\ removed=Apache-2.0 |
213 |
+spec\ evaluation\ license=Apache-2.0 |
214 |
+spec\ implementation\ license=Apache-2.0 |
215 |
+the\ apache\ license,\ version\ 2.0=Apache-2.0 |
216 |
+the\ apache\ software\ license,\ version\ 2.0=Apache-2.0 |
217 |
+the\ bsd\ 2-clause\ license=BSD-2 |
218 |
+the\ bsd\ 3-clause\ license=BSD |
219 |
+the\ bsd\ license=BSD |
220 |
+the\ gnu\ general\ public\ license\ (gpl),\ version\ 2,\ with\ classpath\ exception=GPL-2-with-classpath-exception |
221 |
+the\ gnu\ lesser\ general\ public\ license,\ version\ 2.1=LGPL-2.1 |
222 |
+the\ go\ license=BSD |
223 |
+the\ json\ license=JSON |
224 |
+the\ mit\ license=MIT |
225 |
+the\ new\ bsd\ license=BSD |
226 |
+universal\ permissive\ license,\ version\ 1.0=UPL-1.0 |
227 |
+w3c\ license=W3C |