Skip to content

Commit

Permalink
Merge pull request #976 from mikepenz/feature/ignore_case
Browse files Browse the repository at this point in the history
Ignore case for name of new `allowedLicensesMap`
  • Loading branch information
mikepenz committed Apr 9, 2024
2 parents 5f0c06f + bd8af5a commit 2f5551d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ abstract class AboutLibrariesExtension {

/**
* Defines the allowed licenses for specific libraries which will not result in warnings or failures depending on the [strictMode] configuration.
* This is useful if some dependencies have special licenses which are only used in testing and are accepted for thsi case.
* This is useful if some dependencies have special licenses which are only used in testing and are accepted for this case.
*
* ```
* aboutLibraries {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ abstract class AboutLibrariesTask : BaseAboutLibrariesTask() {
}

val missingMapped = mutableMapOf<License, List<Library>>()
val allowedLicensesMap = allowedLicensesMap.mapKeys { (key, _) -> key.lowercase(Locale.ENGLISH) }
if (allowedLicensesMap.isNotEmpty()) {
missing.forEach {
val id = it.spdxId?.lowercase(Locale.ENGLISH) ?: it.hash.lowercase(Locale.ENGLISH)
val name = it.name.lowercase(Locale.ENGLISH)

val libsForLicense = allowedLicensesMap[id] ?: allowedLicensesMap[name]
if (libsForLicense != null) {
Expand Down

0 comments on commit 2f5551d

Please sign in to comment.