Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore case for name of new allowedLicensesMap #976

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading