From eead6532a4077e8b4693692caf667bb5a0f465bf Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 7 May 2024 16:29:29 +0000 Subject: [PATCH 01/19] Update coursier, ... to 2.1.10 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 94c2e984b..6be85db17 100644 --- a/build.sbt +++ b/build.sbt @@ -24,7 +24,7 @@ inThisBuild(List( Global / excludeLintKeys += scriptedBufferLog Global / excludeLintKeys += scriptedLaunchOpts -def coursierVersion0 = "2.1.9" +def coursierVersion0 = "2.1.10" def coursierDep = ("io.get-coursier" %% "coursier" % coursierVersion0) .exclude("org.codehaus.plexus", "plexus-archiver") .exclude("org.codehaus.plexus", "plexus-container-default") From 4e7e8e8f71654047d0e30224cf2f061d98add07c Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 7 May 2024 16:29:46 +0000 Subject: [PATCH 02/19] Update sbt, scripted-plugin to 1.10.0 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 72413de15..081fdbbc7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.3 +sbt.version=1.10.0 From e1325541332ce7d6f6e8f0d4ee7e8266f8150652 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 24 Jun 2024 12:53:55 +0000 Subject: [PATCH 03/19] Update scalatest to 3.2.19 --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 94c2e984b..758a961ba 100644 --- a/build.sbt +++ b/build.sbt @@ -92,7 +92,7 @@ lazy val `lm-coursier` = project // IvySbt#Module (seems DependencyResolutionInterface.moduleDescriptor // is ignored). lmIvy.value, - "org.scalatest" %% "scalatest" % "3.2.18" % Test + "org.scalatest" %% "scalatest" % "3.2.19" % Test ), Test / exportedProducts := { (Test / preTest).value @@ -163,7 +163,7 @@ lazy val `lm-coursier-shaded` = project "org.scala-lang.modules" %% "scala-xml" % "2.3.0", // depending on that one so that it doesn't get shaded "org.slf4j" % "slf4j-api" % "1.7.36", // depending on that one so that it doesn't get shaded either lmIvy.value, - "org.scalatest" %% "scalatest" % "3.2.18" % Test + "org.scalatest" %% "scalatest" % "3.2.19" % Test ) ) From ed2cae987c5bc391ef229677800d333a0de598c6 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Wed, 3 Jul 2024 09:30:45 +0200 Subject: [PATCH 04/19] Resolve license inheritence in update report In addition to the unit test, tested by running the scripted tests on the `use-update` branch of `sbt-license-report` at https://github.com/sbt/sbt-license-report/pull/123 --- .../lmcoursier/internal/SbtUpdateReport.scala | 28 +++++++++++++++++-- .../scala/lmcoursier/ResolutionSpec.scala | 13 +++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/modules/lm-coursier/src/main/scala/lmcoursier/internal/SbtUpdateReport.scala b/modules/lm-coursier/src/main/scala/lmcoursier/internal/SbtUpdateReport.scala index 55bf9fc4a..e41d6915d 100644 --- a/modules/lm-coursier/src/main/scala/lmcoursier/internal/SbtUpdateReport.scala +++ b/modules/lm-coursier/src/main/scala/lmcoursier/internal/SbtUpdateReport.scala @@ -4,15 +4,16 @@ import java.io.File import java.net.URL import java.util.GregorianCalendar import java.util.concurrent.ConcurrentHashMap - import coursier.cache.CacheUrl import coursier.{Attributes, Dependency, Module, Project, Resolution} -import coursier.core.{Classifier, Configuration, Extension, Publication, Type} +import coursier.core.{Classifier, Configuration, Extension, Info, Publication, Type} import coursier.maven.MavenAttributes import coursier.util.Artifact import sbt.librarymanagement.{Artifact => _, Configuration => _, _} import sbt.util.Logger +import scala.annotation.tailrec + private[internal] object SbtUpdateReport { private def caching[K, V](f: K => V): K => V = { @@ -226,6 +227,26 @@ private[internal] object SbtUpdateReport { ) } + /** + * Assemble the project info, resolving inherited fields. Only implements resolving + * the fields that are relevant for moduleReport + * + * @see https://maven.apache.org/pom.html#Inheritance + * @see https://maven.apache.org/ref/3-LATEST/maven-model-builder/index.html#Inheritance_Assembly + */ + def assemble(project: Project): Project = { + @tailrec + def licenseInfo(project: Project): Seq[Info.License] = { + if (project.info.licenseInfo.nonEmpty || project.parent.isEmpty) + project.info.licenseInfo + else + licenseInfo(lookupProject(project.parent.get).get) + } + project.withInfo( + project.info.withLicenseInfo(licenseInfo(project)) + ) + } + val m = Dependency(thisModule._1, "") val directReverseDependencies = res.rootDependencies.toSet.map(clean).map(_.withVersion("")) .map( @@ -252,6 +273,7 @@ private[internal] object SbtUpdateReport { groupedDepArtifacts.toVector.map { case (dep, artifacts) => val proj = lookupProject(dep.moduleVersion).get + val assembledProject = assemble(proj) // FIXME Likely flaky... val dependees = reverseDependencies @@ -280,7 +302,7 @@ private[internal] object SbtUpdateReport { moduleReport(( dep, dependees, - proj, + assembledProject, filesOpt, classLoaders, )) diff --git a/modules/lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala b/modules/lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala index b74a84d2f..310fd014b 100644 --- a/modules/lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala +++ b/modules/lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala @@ -235,4 +235,17 @@ final class ResolutionSpec extends AnyPropSpec with Matchers { resolution should be('right) } + + property("resolve licenses from parent poms") { + val dependencies = + Vector(("org.apache.commons" % "commons-compress" % "1.26.2")) + val coursierModule = module(lmEngine, stubModule, dependencies, Some("2.12.4")) + val resolution = + lmEngine.update(coursierModule, UpdateConfiguration(), UnresolvedWarningConfiguration(), log) + + resolution should be('right) + val componentConfig = resolution.right.get.configurations.find(_.configuration == Compile.toConfigRef).get + val compress = componentConfig.modules.find(_.module.name == "commons-compress").get + compress.licenses should have size 1 + } } From 6757b15acd6ab3c5d3d8bc5ea4178c0eea631972 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Mon, 8 Jul 2024 23:55:59 -0400 Subject: [PATCH 05/19] Update to Scala 2.12.19 --- build.sbt | 2 +- project/Settings.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 6be85db17..7e32aaaf8 100644 --- a/build.sbt +++ b/build.sbt @@ -16,7 +16,7 @@ inThisBuild(List( ) ), semanticdbEnabled := true, - semanticdbVersion := "4.6.0", + semanticdbVersion := "4.9.8", scalafixDependencies += "net.hamnaberg" %% "dataclass-scalafix" % dataclassScalafixV, libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % "always" )) diff --git a/project/Settings.scala b/project/Settings.scala index 1e3e76863..0f46538ff 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -9,7 +9,7 @@ import com.jsuereth.sbtpgp._ object Settings { - def scala212 = "2.12.17" + def scala212 = "2.12.19" def scala213 = "2.13.10" def targetSbtVersion = "1.2.8" From ee16e46405170a48f2559805b083b75d5bf18425 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 9 Jul 2024 00:00:00 -0400 Subject: [PATCH 06/19] Scala 2.13.14 --- project/Settings.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Settings.scala b/project/Settings.scala index 0f46538ff..4b8ab7db2 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -10,7 +10,7 @@ import com.jsuereth.sbtpgp._ object Settings { def scala212 = "2.12.19" - def scala213 = "2.13.10" + def scala213 = "2.13.14" def targetSbtVersion = "1.2.8" From 881e0e424ea63b69d31827f4d8470dfc2c7d50b0 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 10 Jul 2024 14:18:35 +0000 Subject: [PATCH 07/19] Update sbt, scripted-plugin to 1.10.1 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 081fdbbc7..ee4c672cd 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.0 +sbt.version=1.10.1 From a624ee05e9f264622e38a0ec71be9cf031d5e6e5 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 12 Aug 2024 13:02:15 +0000 Subject: [PATCH 08/19] Update utest to 0.8.4 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index a1ea55170..81c7cc235 100644 --- a/build.sbt +++ b/build.sbt @@ -174,7 +174,7 @@ lazy val `sbt-coursier-shared` = project .settings( plugin, generatePropertyFile, - libraryDependencies += "com.lihaoyi" %% "utest" % "0.8.3" % Test, + libraryDependencies += "com.lihaoyi" %% "utest" % "0.8.4" % Test, testFrameworks += new TestFramework("utest.runner.Framework") ) From ec44c9d09573de6a0ea337d4b96c86ceb0a2e7b1 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 12 Aug 2024 13:02:20 +0000 Subject: [PATCH 09/19] Update sbt-mima-plugin to 1.1.4 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index d1948a370..2e5cbd4b1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") From 821aef839b6da74cac0c9f8174cc2566474e88cd Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 12 Aug 2024 19:27:48 +0000 Subject: [PATCH 10/19] Update sbt-ci-release to 1.6.0 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 2e5cbd4b1..91607db02 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") From 7f2a51179b82ef253f52c676e3dbc6a1662692fb Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 21 Aug 2024 14:22:55 +0000 Subject: [PATCH 11/19] Update sbt-ci-release to 1.6.1 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 91607db02..6e40569eb 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.0") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") From fec763a22cfdc7a22c00cbbf9755c689bf111700 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 6 Sep 2024 13:48:26 +0000 Subject: [PATCH 12/19] Update scala-library to 2.12.20 --- project/Settings.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Settings.scala b/project/Settings.scala index 4b8ab7db2..b2488d6d6 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -9,7 +9,7 @@ import com.jsuereth.sbtpgp._ object Settings { - def scala212 = "2.12.19" + def scala212 = "2.12.20" def scala213 = "2.13.14" def targetSbtVersion = "1.2.8" From 35a12d41af22d7280905621f56f5ee8fdb683481 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Tue, 10 Sep 2024 14:00:00 +0000 Subject: [PATCH 13/19] Update coursier, ... to 2.1.11 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 81c7cc235..247d3f0bb 100644 --- a/build.sbt +++ b/build.sbt @@ -24,7 +24,7 @@ inThisBuild(List( Global / excludeLintKeys += scriptedBufferLog Global / excludeLintKeys += scriptedLaunchOpts -def coursierVersion0 = "2.1.10" +def coursierVersion0 = "2.1.11" def coursierDep = ("io.get-coursier" %% "coursier" % coursierVersion0) .exclude("org.codehaus.plexus", "plexus-archiver") .exclude("org.codehaus.plexus", "plexus-container-default") From d434c94af38b662c4af9f50b4b0706f356440d94 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 12 Sep 2024 14:43:33 +0000 Subject: [PATCH 14/19] Update coursier, ... to 2.1.12 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 247d3f0bb..162812bb1 100644 --- a/build.sbt +++ b/build.sbt @@ -24,7 +24,7 @@ inThisBuild(List( Global / excludeLintKeys += scriptedBufferLog Global / excludeLintKeys += scriptedLaunchOpts -def coursierVersion0 = "2.1.11" +def coursierVersion0 = "2.1.12" def coursierDep = ("io.get-coursier" %% "coursier" % coursierVersion0) .exclude("org.codehaus.plexus", "plexus-archiver") .exclude("org.codehaus.plexus", "plexus-container-default") From 60afb16294a506d73ad05637dbeccc0101272fa0 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Mon, 16 Sep 2024 14:15:32 +0000 Subject: [PATCH 15/19] Update sbt, scripted-plugin to 1.10.2 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index ee4c672cd..0b699c305 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.1 +sbt.version=1.10.2 From 2d53f0d760c295c233ab718f11b85d194de5687f Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Wed, 18 Sep 2024 14:55:38 +0000 Subject: [PATCH 16/19] Update coursier, ... to 2.1.13 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 162812bb1..b95a4f991 100644 --- a/build.sbt +++ b/build.sbt @@ -24,7 +24,7 @@ inThisBuild(List( Global / excludeLintKeys += scriptedBufferLog Global / excludeLintKeys += scriptedLaunchOpts -def coursierVersion0 = "2.1.12" +def coursierVersion0 = "2.1.13" def coursierDep = ("io.get-coursier" %% "coursier" % coursierVersion0) .exclude("org.codehaus.plexus", "plexus-archiver") .exclude("org.codehaus.plexus", "plexus-container-default") From 2f102930edb9c94e98ff51f3670b9b4fa48179b3 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Thu, 26 Sep 2024 14:06:40 +0000 Subject: [PATCH 17/19] Update scala-library to 2.13.15 --- project/Settings.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Settings.scala b/project/Settings.scala index b2488d6d6..040435bbc 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -10,7 +10,7 @@ import com.jsuereth.sbtpgp._ object Settings { def scala212 = "2.12.20" - def scala213 = "2.13.14" + def scala213 = "2.13.15" def targetSbtVersion = "1.2.8" From 173bc720c9dc78e6c221fb5d25c6d104138e66a7 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Sat, 28 Sep 2024 15:24:13 +0000 Subject: [PATCH 18/19] Update sbt-scalafix to 0.13.0 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 6e40569eb..a6f46c934 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.6.1") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5") -addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") +addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0") libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value From b6a9ed02db4b0567f9dbc53d59980106ac772bde Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Tue, 8 Oct 2024 15:25:50 +0200 Subject: [PATCH 19/19] Fix ResolutionSpec --- .../lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala b/modules/lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala index 9a161df77..bad447013 100644 --- a/modules/lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala +++ b/modules/lm-coursier/src/test/scala/lmcoursier/ResolutionSpec.scala @@ -243,7 +243,7 @@ final class ResolutionSpec extends AnyPropSpec with Matchers { val resolution = lmEngine.update(coursierModule, UpdateConfiguration(), UnresolvedWarningConfiguration(), log) - resolution should be('right) + assert(resolution.isRight) val componentConfig = resolution.right.get.configurations.find(_.configuration == Compile.toConfigRef).get val compress = componentConfig.modules.find(_.module.name == "commons-compress").get compress.licenses should have size 1