Skip to content

Commit

Permalink
Fix filtering of licenseConfigurations
Browse files Browse the repository at this point in the history
With the changes of #86, the filtering of configurations broke and test dependencies got reported even though licenseConfigurations was set to Set("compile"). This is due to the fact that the resolved Ivy deps not properly mirror the configurations the dependency was defined for. By selecting the configurations from the report early on, we restore the filtering.
  • Loading branch information
ybasket committed Nov 5, 2024
1 parent 47d1ee1 commit eac507f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/scala/sbtlicensereport/license/LicenseReport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,13 @@ object LicenseReport {

private def getLicenses(
report: UpdateReport,
configs: Set[String] = Set.empty,
categories: Seq[LicenseCategory] = LicenseCategory.all,
configs: Set[String],
categories: Seq[LicenseCategory],
originatingModule: DepModuleInfo
): Seq[DepLicense] = {
val relevantConfigurations = report.configurations.filter(c => configs.contains(c.configuration.name))
for {
dep <- allModuleReports(report.configurations)
dep <- allModuleReports(relevantConfigurations)
report <- pickLicenseForDep(dep, configs, categories, originatingModule)
} yield report
}
Expand Down

0 comments on commit eac507f

Please sign in to comment.