File tree Expand file tree Collapse file tree 1 file changed +18
-11
lines changed
tools/curations/buildSrc/src/main/kotlin Expand file tree Collapse file tree 1 file changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -162,18 +162,25 @@ private fun LicenseDetails.getCategories(): Set<String> {
162
162
)
163
163
}
164
164
165
- private fun getLicenseClassifications (licenseDetails : Collection <LicenseDetails >) =
166
- LicenseClassifications (
167
- categories = licenseDetails.flatMap { it.getCategories() }.distinct().map {
168
- LicenseCategory (it)
169
- }.sortedBy { it.name },
170
- categorizations = licenseDetails.map {
171
- LicenseCategorization (
172
- id = it.getLicenseId(),
173
- categories = it.getCategories()
174
- )
175
- }.sortedBy { it.id.toString() }
165
+ private fun getLicenseClassifications (licenseDetails : Collection <LicenseDetails >): LicenseClassifications {
166
+ val categories = licenseDetails.flatMap { details ->
167
+ details.getCategories()
168
+ }.distinct().map { category ->
169
+ LicenseCategory (category)
170
+ }
171
+
172
+ val categorizations = licenseDetails.map { details ->
173
+ LicenseCategorization (
174
+ id = details.getLicenseId(),
175
+ categories = details.getCategories()
176
+ )
177
+ }
178
+
179
+ return LicenseClassifications (
180
+ categories = categories.sortedBy { it.name },
181
+ categorizations = categorizations.sortedBy { it.id.toString() }
176
182
)
183
+ }
177
184
178
185
/* *
179
186
* Generate license classifications from ScanCode's license categories.
You can’t perform that action at this time.
0 commit comments