diff --git a/src/main/scala/sbtlicensereport/SbtLicenseReport.scala b/src/main/scala/sbtlicensereport/SbtLicenseReport.scala index 0bc1bc1..b5bd66f 100644 --- a/src/main/scala/sbtlicensereport/SbtLicenseReport.scala +++ b/src/main/scala/sbtlicensereport/SbtLicenseReport.scala @@ -41,7 +41,7 @@ object SbtLicenseReport extends AutoPlugin { val licenseReportDir = settingKey[File]("The location where we'll write the license reports.") val licenseReportStyleRules = settingKey[Option[String]]("The style rules for license report styling.") val licenseReportTitle = settingKey[String]("The name of the license report.") - val licenseConfigurations = settingKey[Set[String]]("The ivy configurations we wish a report of.") + val licenseConfigurations = settingKey[Set[Configuration]]("The ivy configurations we wish a report of.") val licenseSelection = settingKey[Seq[LicenseCategory]]( "A priority-order list mechanism we can use to select licenses for builds that have more than one." ) @@ -137,7 +137,7 @@ object SbtLicenseReport extends AutoPlugin { override lazy val globalSettings = Seq( licenseSelection := LicenseCategory.all, - licenseConfigurations := Set("compile", "test"), + licenseConfigurations := Set(Compile, Test), // Here we use an empty partial function licenseReportNotes := PartialFunction.empty, licenseOverrides := PartialFunction.empty, diff --git a/src/main/scala/sbtlicensereport/license/LicenseReport.scala b/src/main/scala/sbtlicensereport/license/LicenseReport.scala index 352bc56..41b0271 100644 --- a/src/main/scala/sbtlicensereport/license/LicenseReport.scala +++ b/src/main/scala/sbtlicensereport/license/LicenseReport.scala @@ -85,7 +85,7 @@ object LicenseReport { def makeReport( module: IvySbt#Module, - configs: Set[String], + configs: Set[Configuration], licenseSelection: Seq[LicenseCategory], overrides: DepModuleInfo => Option[LicenseInfo], exclusions: DepModuleInfo => Option[Boolean], @@ -123,14 +123,14 @@ object LicenseReport { /** Picks a single license (or none) for this dependency. */ private def pickLicenseForDep( dep: IvyNode, - configs: Set[String], + configs: Set[Configuration], categories: Seq[LicenseCategory], originatingModule: DepModuleInfo ): Option[DepLicense] = for { d <- Option(dep) cs = dep.getRootModuleConfigurations.toSet - filteredConfigs = if (cs.isEmpty) cs else cs.filter(configs) + filteredConfigs = if (cs.isEmpty) cs else cs.filter(configs.map(_.name)) if !filteredConfigs.isEmpty if !filteredConfigs.forall(d.isEvicted) desc <- Option(dep.getDescriptor) @@ -155,7 +155,7 @@ object LicenseReport { private def getLicenses( report: ResolveReport, - configs: Set[String] = Set.empty, + configs: Set[Configuration] = Set.empty, categories: Seq[LicenseCategory] = LicenseCategory.all, originatingModule: DepModuleInfo ): Seq[DepLicense] = { @@ -168,7 +168,7 @@ object LicenseReport { private def makeReportImpl( report: ResolveReport, - configs: Set[String], + configs: Set[Configuration], categories: Seq[LicenseCategory], overrides: DepModuleInfo => Option[LicenseInfo], exclusions: DepModuleInfo => Option[Boolean], diff --git a/src/sbt-test/dumpLicenseReport/custom-report/example.sbt b/src/sbt-test/dumpLicenseReport/custom-report/example.sbt index 57817c7..16d3a30 100644 --- a/src/sbt-test/dumpLicenseReport/custom-report/example.sbt +++ b/src/sbt-test/dumpLicenseReport/custom-report/example.sbt @@ -2,7 +2,7 @@ name := "example" licenseReportTitle := "lreport" -licenseConfigurations := Set("compile") +licenseConfigurations := Set(Compile) licenseSelection := Seq(LicenseCategory.BSD)